@unispechq/unispec-schema 0.4.0 → 0.4.2
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 +170 -162
- package/examples/README.md +128 -0
- package/examples/invalid/config/additional-properties.json +26 -0
- package/examples/invalid/config/missing-service-name.json +22 -0
- package/examples/invalid/config/missing-version.json +6 -0
- package/examples/invalid/graphql-additional-properties.json +22 -0
- package/examples/invalid/graphql-missing-arg-type.json +26 -0
- package/examples/invalid/graphql-missing-name.json +19 -0
- package/examples/invalid/graphql-missing-schema.json +19 -0
- package/examples/invalid/mixed-invalid-protocol.json +26 -0
- package/examples/invalid/mixed-missing-graphql-schema.json +33 -0
- package/examples/invalid/mixed-multiple-errors.json +41 -0
- package/examples/invalid/rest-additional-properties.json +25 -0
- package/examples/invalid/rest-invalid-identifiers.json +29 -0
- package/examples/invalid/rest-invalid-method.json +23 -0
- package/examples/invalid/rest-missing-required.json +21 -0
- package/examples/invalid/websocket-additional-properties.json +27 -0
- package/examples/invalid/websocket-invalid-direction.json +27 -0
- package/examples/invalid/websocket-missing-channel-name.json +25 -0
- package/examples/invalid/websocket-missing-message-name.json +25 -0
- package/examples/valid/config/complete.json +61 -0
- package/examples/valid/config/minimal.json +8 -0
- package/examples/valid/graphql-complete.json +348 -0
- package/examples/valid/graphql-simple.json +34 -0
- package/examples/valid/mixed-complete.json +799 -0
- package/examples/valid/mixed-simple.json +56 -0
- package/examples/valid/rest-complete.json +539 -0
- package/examples/valid/rest-simple.json +279 -0
- package/examples/valid/websocket-complete.json +471 -0
- package/examples/valid/websocket-simple.json +116 -0
- package/index.cjs +7 -7
- package/index.d.ts +9 -9
- package/index.mjs +9 -9
- package/package.json +15 -6
- package/schema/index.json +19 -19
- package/schema/types/common.schema.json +195 -195
- package/schema/types/graphql.schema.json +172 -172
- package/schema/types/rest.schema.json +221 -226
- package/schema/types/schemas.schema.json +84 -84
- package/schema/types/service.schema.json +158 -158
- package/schema/types/websocket.schema.json +185 -190
- package/schema/unispec-config.schema.json +509 -509
- package/schema/unispec-tests.schema.json +368 -378
- package/schema/unispec.schema.json +18 -23
|
@@ -1,172 +1,172 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/graphql.schema.json",
|
|
4
|
+
"title": "GraphQL API surface",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"Argument": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"required": ["name", "type"],
|
|
10
|
+
"properties": {
|
|
11
|
+
"name": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Argument name as it appears in the GraphQL operation."
|
|
14
|
+
},
|
|
15
|
+
"type": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "GraphQL type string (e.g., 'ID!', '[User]', 'PostFilter')."
|
|
18
|
+
},
|
|
19
|
+
"description": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Human-readable description of the argument."
|
|
22
|
+
},
|
|
23
|
+
"defaultValue": {
|
|
24
|
+
"description": "Default value for the argument (any JSON value)."
|
|
25
|
+
},
|
|
26
|
+
"deprecated": {
|
|
27
|
+
"type": "boolean",
|
|
28
|
+
"description": "Marks the argument as deprecated.",
|
|
29
|
+
"default": false
|
|
30
|
+
},
|
|
31
|
+
"deprecationReason": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Human-readable reason for deprecation."
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"additionalProperties": false
|
|
37
|
+
},
|
|
38
|
+
"SecurityRequirement": {
|
|
39
|
+
"type": "array",
|
|
40
|
+
"description": "Alternative set of named security schemes applied to an operation.",
|
|
41
|
+
"items": {
|
|
42
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"Header": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"required": ["name"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"name": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Header name (case-insensitive)."
|
|
52
|
+
},
|
|
53
|
+
"description": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Human-readable description of the header."
|
|
56
|
+
},
|
|
57
|
+
"required": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"description": "Whether this header is required.",
|
|
60
|
+
"default": false
|
|
61
|
+
},
|
|
62
|
+
"defaultValue": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "Default value for the header."
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"additionalProperties": false
|
|
68
|
+
},
|
|
69
|
+
"Operation": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"required": ["name"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"name": {
|
|
74
|
+
"$ref": "./common.schema.json#/$defs/Identifier"
|
|
75
|
+
},
|
|
76
|
+
"description": {
|
|
77
|
+
"$ref": "./common.schema.json#/$defs/Description"
|
|
78
|
+
},
|
|
79
|
+
"tags": {
|
|
80
|
+
"type": "array",
|
|
81
|
+
"description": "Tags for grouping operations.",
|
|
82
|
+
"items": {
|
|
83
|
+
"$ref": "./common.schema.json#/$defs/Tag"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"deprecated": {
|
|
87
|
+
"type": "boolean",
|
|
88
|
+
"description": "Marks the operation as deprecated.",
|
|
89
|
+
"default": false
|
|
90
|
+
},
|
|
91
|
+
"deprecationReason": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "Human-readable reason for deprecation."
|
|
94
|
+
},
|
|
95
|
+
"args": {
|
|
96
|
+
"type": "array",
|
|
97
|
+
"description": "Arguments for this GraphQL operation.",
|
|
98
|
+
"items": {
|
|
99
|
+
"$ref": "#/$defs/Argument"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"returnType": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "GraphQL return type (e.g., 'User!', '[User]')."
|
|
105
|
+
},
|
|
106
|
+
"headers": {
|
|
107
|
+
"type": "array",
|
|
108
|
+
"description": "HTTP headers relevant for this operation.",
|
|
109
|
+
"items": {
|
|
110
|
+
"$ref": "#/$defs/Header"
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"security": {
|
|
114
|
+
"type": "array",
|
|
115
|
+
"description": "Security requirements for this operation. Each item represents an alternative set of named security schemes.",
|
|
116
|
+
"items": {
|
|
117
|
+
"$ref": "#/$defs/SecurityRequirement"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"additionalProperties": false
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"properties": {
|
|
125
|
+
"url": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "Optional path or URL of the GraphQL endpoint. Recommended: relative path (e.g. '/graphql'). Absolute URLs are allowed only if the service is tightly bound to a single host. If omitted, tooling may assume a framework default (commonly '/graphql')."
|
|
128
|
+
},
|
|
129
|
+
"schema": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"description": "GraphQL schema SDL as a string. Canonical source of type definitions."
|
|
132
|
+
},
|
|
133
|
+
"securitySchemes": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"description": "Authentication mechanisms available for this GraphQL surface.",
|
|
136
|
+
"additionalProperties": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"description": "Security scheme definition (shape is intentionally flexible and may evolve).",
|
|
139
|
+
"additionalProperties": true
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"headers": {
|
|
143
|
+
"type": "array",
|
|
144
|
+
"description": "HTTP headers commonly used for GraphQL requests.",
|
|
145
|
+
"items": {
|
|
146
|
+
"$ref": "#/$defs/Header"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"queries": {
|
|
150
|
+
"type": "array",
|
|
151
|
+
"description": "Query operations exposed by the GraphQL API.",
|
|
152
|
+
"items": {
|
|
153
|
+
"$ref": "#/$defs/Operation"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"mutations": {
|
|
157
|
+
"type": "array",
|
|
158
|
+
"description": "Mutation operations exposed by the GraphQL API.",
|
|
159
|
+
"items": {
|
|
160
|
+
"$ref": "#/$defs/Operation"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"subscriptions": {
|
|
164
|
+
"type": "array",
|
|
165
|
+
"description": "Subscription operations exposed by the GraphQL API.",
|
|
166
|
+
"items": {
|
|
167
|
+
"$ref": "#/$defs/Operation"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"additionalProperties": false
|
|
172
|
+
}
|