@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
package/schema/index.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"name": "@unispechq/unispec-schema",
|
|
4
|
+
"description": "Official UniSpec JSON Schemas",
|
|
5
|
+
"root": "./unispec.schema.json",
|
|
6
|
+
"types": {
|
|
7
|
+
"common": "./types/common.schema.json",
|
|
8
|
+
"graphql": "./types/graphql.schema.json",
|
|
9
|
+
"rest": "./types/rest.schema.json",
|
|
10
|
+
"schemas": "./types/schemas.schema.json",
|
|
11
|
+
"service": "./types/service.schema.json",
|
|
12
|
+
"websocket": "./types/websocket.schema.json"
|
|
13
|
+
},
|
|
14
|
+
"documents": {
|
|
15
|
+
"unispec": "./unispec.schema.json",
|
|
16
|
+
"unispecTests": "./unispec-tests.schema.json",
|
|
17
|
+
"unispecConfig": "./unispec-config.schema.json"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,195 +1,195 @@
|
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://unispec.dev/schema/types/common.schema.json",
|
|
4
|
+
"title": "Common UniSpec definitions",
|
|
5
|
+
"$defs": {
|
|
6
|
+
"Identifier": {
|
|
7
|
+
"type": "string",
|
|
8
|
+
"description": "Identifier for services, operations, channels, etc.",
|
|
9
|
+
"pattern": "^[A-Za-z_][A-Za-z0-9_.:-]*$"
|
|
10
|
+
},
|
|
11
|
+
"Description": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Human-readable description text."
|
|
14
|
+
},
|
|
15
|
+
"Email": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Email address with validation.",
|
|
18
|
+
"format": "email",
|
|
19
|
+
"pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
|
|
20
|
+
},
|
|
21
|
+
"Url": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "URL with validation.",
|
|
24
|
+
"format": "uri",
|
|
25
|
+
"pattern": "^https?://[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}.*$"
|
|
26
|
+
},
|
|
27
|
+
"Version": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Semantic version string (SemVer).",
|
|
30
|
+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
|
|
31
|
+
},
|
|
32
|
+
"Tag": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"description": "Tag for grouping operations and resources.",
|
|
35
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_-]*$"
|
|
36
|
+
},
|
|
37
|
+
"SecurityScheme": {
|
|
38
|
+
"type": "object",
|
|
39
|
+
"discriminator": {
|
|
40
|
+
"propertyName": "type"
|
|
41
|
+
},
|
|
42
|
+
"oneOf": [
|
|
43
|
+
{
|
|
44
|
+
"$ref": "#/$defs/ApiKeyScheme"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"$ref": "#/$defs/HttpScheme"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"$ref": "#/$defs/OAuth2Scheme"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"$ref": "#/$defs/JwtScheme"
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"ApiKeyScheme": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"properties": {
|
|
60
|
+
"type": {
|
|
61
|
+
"const": "apiKey"
|
|
62
|
+
},
|
|
63
|
+
"name": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "Name of the API key header or query parameter."
|
|
66
|
+
},
|
|
67
|
+
"in": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"enum": ["header", "query", "cookie"],
|
|
70
|
+
"description": "Location of the API key."
|
|
71
|
+
},
|
|
72
|
+
"description": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"description": "Description of the API key usage."
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"required": ["type", "name", "in"],
|
|
78
|
+
"additionalProperties": false
|
|
79
|
+
},
|
|
80
|
+
"HttpScheme": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"type": {
|
|
84
|
+
"const": "http"
|
|
85
|
+
},
|
|
86
|
+
"scheme": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"enum": ["basic", "bearer", "digest"],
|
|
89
|
+
"description": "HTTP authentication scheme."
|
|
90
|
+
},
|
|
91
|
+
"bearerFormat": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "Format of the bearer token (e.g., JWT)."
|
|
94
|
+
},
|
|
95
|
+
"description": {
|
|
96
|
+
"type": "string",
|
|
97
|
+
"description": "Description of the HTTP authentication scheme."
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": ["type", "scheme"],
|
|
101
|
+
"additionalProperties": false
|
|
102
|
+
},
|
|
103
|
+
"OAuth2Scheme": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"properties": {
|
|
106
|
+
"type": {
|
|
107
|
+
"const": "oauth2"
|
|
108
|
+
},
|
|
109
|
+
"flows": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"description": "OAuth2 authorization flows.",
|
|
112
|
+
"properties": {
|
|
113
|
+
"authorizationCode": {
|
|
114
|
+
"$ref": "#/$defs/OAuth2Flow"
|
|
115
|
+
},
|
|
116
|
+
"clientCredentials": {
|
|
117
|
+
"$ref": "#/$defs/OAuth2Flow"
|
|
118
|
+
},
|
|
119
|
+
"implicit": {
|
|
120
|
+
"$ref": "#/$defs/OAuth2Flow"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
},
|
|
125
|
+
"description": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"description": "Description of the OAuth2 scheme."
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": ["type", "flows"],
|
|
131
|
+
"additionalProperties": false
|
|
132
|
+
},
|
|
133
|
+
"JwtScheme": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"properties": {
|
|
136
|
+
"type": {
|
|
137
|
+
"const": "jwt"
|
|
138
|
+
},
|
|
139
|
+
"issuer": {
|
|
140
|
+
"type": "string",
|
|
141
|
+
"description": "JWT issuer URL."
|
|
142
|
+
},
|
|
143
|
+
"audience": {
|
|
144
|
+
"type": "array",
|
|
145
|
+
"items": {
|
|
146
|
+
"type": "string"
|
|
147
|
+
},
|
|
148
|
+
"description": "Allowed JWT audiences."
|
|
149
|
+
},
|
|
150
|
+
"algorithms": {
|
|
151
|
+
"type": "array",
|
|
152
|
+
"items": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"description": "Allowed JWT algorithms."
|
|
156
|
+
},
|
|
157
|
+
"description": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"description": "Description of the JWT scheme."
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"required": ["type"],
|
|
163
|
+
"additionalProperties": false
|
|
164
|
+
},
|
|
165
|
+
"OAuth2Flow": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"properties": {
|
|
168
|
+
"authorizationUrl": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"format": "uri",
|
|
171
|
+
"description": "Authorization URL."
|
|
172
|
+
},
|
|
173
|
+
"tokenUrl": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"format": "uri",
|
|
176
|
+
"description": "Token URL."
|
|
177
|
+
},
|
|
178
|
+
"refreshUrl": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"format": "uri",
|
|
181
|
+
"description": "Refresh token URL."
|
|
182
|
+
},
|
|
183
|
+
"scopes": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"description": "Available scopes.",
|
|
186
|
+
"additionalProperties": {
|
|
187
|
+
"type": "string"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"required": ["authorizationUrl", "tokenUrl", "scopes"],
|
|
192
|
+
"additionalProperties": false
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|