@unispechq/unispec-schema 0.3.1 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +195 -166
- package/index.cjs +7 -7
- package/index.d.ts +9 -9
- package/index.mjs +9 -9
- package/package.json +8 -1
- package/schema/index.json +14 -14
- package/schema/types/common.schema.json +16 -16
- package/schema/types/graphql.schema.json +58 -58
- package/schema/types/rest.schema.json +167 -167
- package/schema/types/schemas.schema.json +25 -25
- package/schema/types/service.schema.json +39 -96
- package/schema/types/websocket.schema.json +89 -89
- package/schema/unispec-tests.schema.json +318 -318
- package/schema/unispec.schema.json +23 -23
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "https://unispec.dev/schema/types/websocket.schema.json",
|
|
4
|
-
"title": "WebSocket API surface",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"$defs": {
|
|
7
|
-
"Message": {
|
|
8
|
-
"type": "object",
|
|
9
|
-
"required": ["name"],
|
|
10
|
-
"properties": {
|
|
11
|
-
"name": {
|
|
12
|
-
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
13
|
-
},
|
|
14
|
-
"description": {
|
|
15
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
16
|
-
},
|
|
17
|
-
"schemaRef": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"description": "Reference to a reusable schema describing the message payload."
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"additionalProperties": false
|
|
23
|
-
},
|
|
24
|
-
"SecurityRequirement": {
|
|
25
|
-
"type": "array",
|
|
26
|
-
"description": "Alternative set of named security schemes applied to a WebSocket channel.",
|
|
27
|
-
"items": {
|
|
28
|
-
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"Channel": {
|
|
32
|
-
"type": "object",
|
|
33
|
-
"required": ["name"],
|
|
34
|
-
"properties": {
|
|
35
|
-
"name": {
|
|
36
|
-
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
37
|
-
},
|
|
38
|
-
"description": {
|
|
39
|
-
"$ref": "./common.schema.json#/$defs/Description"
|
|
40
|
-
},
|
|
41
|
-
"direction": {
|
|
42
|
-
"type": "string",
|
|
43
|
-
"description": "Direction of message flow on this channel.",
|
|
44
|
-
"enum": ["publish", "subscribe", "both"],
|
|
45
|
-
"default": "both"
|
|
46
|
-
},
|
|
47
|
-
"messages": {
|
|
48
|
-
"type": "array",
|
|
49
|
-
"description": "Messages that may be sent or received on this channel.",
|
|
50
|
-
"items": {
|
|
51
|
-
"$ref": "#/$defs/Message"
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
"security": {
|
|
55
|
-
"type": "array",
|
|
56
|
-
"description": "Security requirements for this channel. Each item represents an alternative set of named security schemes.",
|
|
57
|
-
"items": {
|
|
58
|
-
"$ref": "#/$defs/SecurityRequirement"
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
"extensions": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"description": "Custom vendor-specific extensions (x-*) for this channel.",
|
|
64
|
-
"additionalProperties": true
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"additionalProperties": false
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"properties": {
|
|
71
|
-
"channels": {
|
|
72
|
-
"type": "array",
|
|
73
|
-
"description": "WebSocket channels/topics exposed by the service.",
|
|
74
|
-
"items": {
|
|
75
|
-
"$ref": "#/$defs/Channel"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
"securitySchemes": {
|
|
79
|
-
"type": "object",
|
|
80
|
-
"description": "Authentication mechanisms available for this WebSocket surface.",
|
|
81
|
-
"additionalProperties": {
|
|
82
|
-
"type": "object",
|
|
83
|
-
"description": "Security scheme definition (shape is intentionally flexible and may evolve).",
|
|
84
|
-
"additionalProperties": true
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"additionalProperties": false
|
|
89
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/websocket.schema.json",
|
|
4
|
+
"title": "WebSocket API surface",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"Message": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["name"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"name": {
|
|
12
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
13
|
+
},
|
|
14
|
+
"description": {
|
|
15
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
16
|
+
},
|
|
17
|
+
"schemaRef": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Reference to a reusable schema describing the message payload. Recommended format: <SchemaName> (where SchemaName is a key in service.schemas). Tools may also accept a JSON Pointer in the form #/service/schemas/<SchemaName>."
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
},
|
|
24
|
+
"SecurityRequirement": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"description": "Alternative set of named security schemes applied to a WebSocket channel.",
|
|
27
|
+
"items": {
|
|
28
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"Channel": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"required": ["name"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"name": {
|
|
36
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
37
|
+
},
|
|
38
|
+
"description": {
|
|
39
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
40
|
+
},
|
|
41
|
+
"direction": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Direction of message flow on this channel.",
|
|
44
|
+
"enum": ["publish", "subscribe", "both"],
|
|
45
|
+
"default": "both"
|
|
46
|
+
},
|
|
47
|
+
"messages": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"description": "Messages that may be sent or received on this channel.",
|
|
50
|
+
"items": {
|
|
51
|
+
"$ref": "#/$defs/Message"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"security": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"description": "Security requirements for this channel. Each item represents an alternative set of named security schemes.",
|
|
57
|
+
"items": {
|
|
58
|
+
"$ref": "#/$defs/SecurityRequirement"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"extensions": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"description": "Custom vendor-specific extensions (x-*) for this channel.",
|
|
64
|
+
"additionalProperties": true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"properties": {
|
|
71
|
+
"channels": {
|
|
72
|
+
"type": "array",
|
|
73
|
+
"description": "WebSocket channels/topics exposed by the service.",
|
|
74
|
+
"items": {
|
|
75
|
+
"$ref": "#/$defs/Channel"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"securitySchemes": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"description": "Authentication mechanisms available for this WebSocket surface.",
|
|
81
|
+
"additionalProperties": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"description": "Security scheme definition (shape is intentionally flexible and may evolve).",
|
|
84
|
+
"additionalProperties": true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"additionalProperties": false
|
|
89
|
+
}
|