json_schemer 0.2.18 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +7 -7
- data/CHANGELOG.md +102 -0
- data/Gemfile.lock +30 -10
- data/README.md +402 -6
- data/bin/hostname_character_classes +42 -0
- data/bin/rake +29 -0
- data/exe/json_schemer +62 -0
- data/json_schemer.gemspec +9 -12
- data/lib/json_schemer/cached_resolver.rb +16 -0
- data/lib/json_schemer/configuration.rb +31 -0
- data/lib/json_schemer/content.rb +18 -0
- data/lib/json_schemer/draft201909/meta.rb +320 -0
- data/lib/json_schemer/draft201909/vocab/applicator.rb +104 -0
- data/lib/json_schemer/draft201909/vocab/core.rb +45 -0
- data/lib/json_schemer/draft201909/vocab.rb +31 -0
- data/lib/json_schemer/draft202012/meta.rb +364 -0
- data/lib/json_schemer/draft202012/vocab/applicator.rb +382 -0
- data/lib/json_schemer/draft202012/vocab/content.rb +52 -0
- data/lib/json_schemer/draft202012/vocab/core.rb +160 -0
- data/lib/json_schemer/draft202012/vocab/format_annotation.rb +23 -0
- data/lib/json_schemer/draft202012/vocab/format_assertion.rb +23 -0
- data/lib/json_schemer/draft202012/vocab/meta_data.rb +30 -0
- data/lib/json_schemer/draft202012/vocab/unevaluated.rb +104 -0
- data/lib/json_schemer/draft202012/vocab/validation.rb +286 -0
- data/lib/json_schemer/draft202012/vocab.rb +105 -0
- data/lib/json_schemer/draft4/meta.rb +161 -0
- data/lib/json_schemer/draft4/vocab/validation.rb +39 -0
- data/lib/json_schemer/draft4/vocab.rb +18 -0
- data/lib/json_schemer/draft6/meta.rb +172 -0
- data/lib/json_schemer/draft6/vocab.rb +16 -0
- data/lib/json_schemer/draft7/meta.rb +183 -0
- data/lib/json_schemer/draft7/vocab/validation.rb +69 -0
- data/lib/json_schemer/draft7/vocab.rb +30 -0
- data/lib/json_schemer/ecma_regexp.rb +51 -0
- data/lib/json_schemer/errors.rb +1 -0
- data/lib/json_schemer/format/duration.rb +23 -0
- data/lib/json_schemer/format/email.rb +56 -0
- data/lib/json_schemer/format/hostname.rb +58 -0
- data/lib/json_schemer/format/json_pointer.rb +18 -0
- data/lib/json_schemer/format/uri_template.rb +34 -0
- data/lib/json_schemer/format.rb +128 -109
- data/lib/json_schemer/keyword.rb +56 -0
- data/lib/json_schemer/location.rb +25 -0
- data/lib/json_schemer/openapi.rb +38 -0
- data/lib/json_schemer/openapi30/document.rb +1672 -0
- data/lib/json_schemer/openapi30/meta.rb +32 -0
- data/lib/json_schemer/openapi30/vocab/base.rb +18 -0
- data/lib/json_schemer/openapi30/vocab.rb +12 -0
- data/lib/json_schemer/openapi31/document.rb +1557 -0
- data/lib/json_schemer/openapi31/meta.rb +136 -0
- data/lib/json_schemer/openapi31/vocab/base.rb +127 -0
- data/lib/json_schemer/openapi31/vocab.rb +18 -0
- data/lib/json_schemer/output.rb +56 -0
- data/lib/json_schemer/result.rb +242 -0
- data/lib/json_schemer/schema.rb +424 -0
- data/lib/json_schemer/version.rb +1 -1
- data/lib/json_schemer.rb +243 -30
- metadata +141 -25
- data/lib/json_schemer/cached_ref_resolver.rb +0 -14
- data/lib/json_schemer/schema/base.rb +0 -658
- data/lib/json_schemer/schema/draft4.rb +0 -44
- data/lib/json_schemer/schema/draft6.rb +0 -25
- data/lib/json_schemer/schema/draft7.rb +0 -32
@@ -0,0 +1,1557 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module JSONSchemer
|
3
|
+
module OpenAPI31
|
4
|
+
module Document
|
5
|
+
# http://json-schema.org/blog/posts/validating-openapi-and-json-schema
|
6
|
+
DIALECTS = [
|
7
|
+
OpenAPI31::BASE_URI.to_s,
|
8
|
+
Draft202012::BASE_URI.to_s,
|
9
|
+
Draft201909::BASE_URI.to_s,
|
10
|
+
Draft7::BASE_URI.to_s,
|
11
|
+
Draft6::BASE_URI.to_s,
|
12
|
+
Draft4::BASE_URI.to_s
|
13
|
+
]
|
14
|
+
DEFAULT_DIALECT, *OTHER_DIALECTS = DIALECTS
|
15
|
+
|
16
|
+
def self.dialect_schema(dialect)
|
17
|
+
{
|
18
|
+
'$id' => dialect.object_id.to_s,
|
19
|
+
'$ref' => 'https://spec.openapis.org/oas/3.1/schema/2022-10-07',
|
20
|
+
'$defs' => {
|
21
|
+
'schema' => {
|
22
|
+
'$dynamicAnchor' => 'meta',
|
23
|
+
'properties' => {
|
24
|
+
'$schema' => {
|
25
|
+
'$ref' => 'json-schemer://openapi31/schema-base#/$defs/dialect'
|
26
|
+
}
|
27
|
+
},
|
28
|
+
'allOf' => [
|
29
|
+
{
|
30
|
+
'if' => {
|
31
|
+
'properties' => {
|
32
|
+
'$schema' => {
|
33
|
+
'const' => dialect
|
34
|
+
}
|
35
|
+
}
|
36
|
+
},
|
37
|
+
'then' => {
|
38
|
+
'$ref' => dialect
|
39
|
+
}
|
40
|
+
},
|
41
|
+
*(DIALECTS - [dialect]).map do |other_dialect|
|
42
|
+
{
|
43
|
+
'if' => {
|
44
|
+
'type' => 'object',
|
45
|
+
'required' => ['$schema'],
|
46
|
+
'properties' => {
|
47
|
+
'$schema' => {
|
48
|
+
'const' => other_dialect
|
49
|
+
}
|
50
|
+
}
|
51
|
+
},
|
52
|
+
'then' => {
|
53
|
+
'$ref' => other_dialect
|
54
|
+
}
|
55
|
+
}
|
56
|
+
end
|
57
|
+
]
|
58
|
+
}
|
59
|
+
}
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
SCHEMA_BASE = {
|
64
|
+
'$id' => 'json-schemer://openapi31/schema-base',
|
65
|
+
'$schema' => 'https://json-schema.org/draft/2020-12/schema',
|
66
|
+
'$defs' => {
|
67
|
+
'dialect' => {
|
68
|
+
'enum' => DIALECTS
|
69
|
+
}
|
70
|
+
},
|
71
|
+
'properties' => {
|
72
|
+
'jsonSchemaDialect' => {
|
73
|
+
'$ref' => '#/$defs/dialect'
|
74
|
+
}
|
75
|
+
},
|
76
|
+
'allOf' => [
|
77
|
+
{
|
78
|
+
'if' => {
|
79
|
+
'properties' => {
|
80
|
+
'jsonSchemaDialect' => {
|
81
|
+
'const' => DEFAULT_DIALECT
|
82
|
+
}
|
83
|
+
}
|
84
|
+
},
|
85
|
+
'then' => dialect_schema(DEFAULT_DIALECT)
|
86
|
+
},
|
87
|
+
*OTHER_DIALECTS.map do |other_dialect|
|
88
|
+
{
|
89
|
+
'if' => {
|
90
|
+
'type' => 'object',
|
91
|
+
'required' => ['jsonSchemaDialect'],
|
92
|
+
'properties' => {
|
93
|
+
'jsonSchemaDialect' => {
|
94
|
+
'const' => other_dialect
|
95
|
+
}
|
96
|
+
}
|
97
|
+
},
|
98
|
+
'then' => dialect_schema(other_dialect)
|
99
|
+
}
|
100
|
+
end
|
101
|
+
]
|
102
|
+
}
|
103
|
+
|
104
|
+
SCHEMA = {
|
105
|
+
'$id' => 'https://spec.openapis.org/oas/3.1/schema/2022-10-07',
|
106
|
+
'$schema' => 'https://json-schema.org/draft/2020-12/schema',
|
107
|
+
'description' => 'The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0',
|
108
|
+
'type' => 'object',
|
109
|
+
'properties' => {
|
110
|
+
'openapi' => {
|
111
|
+
'type' => 'string',
|
112
|
+
'pattern' => '^3\.1\.\d+(-.+)?$'
|
113
|
+
},
|
114
|
+
'info' => {
|
115
|
+
'$ref' => '#/$defs/info'
|
116
|
+
},
|
117
|
+
'jsonSchemaDialect' => {
|
118
|
+
'type' => 'string',
|
119
|
+
'format' => 'uri',
|
120
|
+
'default' => 'https://spec.openapis.org/oas/3.1/dialect/base'
|
121
|
+
},
|
122
|
+
'servers' => {
|
123
|
+
'type' => 'array',
|
124
|
+
'items' => {
|
125
|
+
'$ref' => '#/$defs/server'
|
126
|
+
},
|
127
|
+
'default' => [
|
128
|
+
{
|
129
|
+
'url' => '/'
|
130
|
+
}
|
131
|
+
]
|
132
|
+
},
|
133
|
+
'paths' => {
|
134
|
+
'$ref' => '#/$defs/paths'
|
135
|
+
},
|
136
|
+
'webhooks' => {
|
137
|
+
'type' => 'object',
|
138
|
+
'additionalProperties' => {
|
139
|
+
'$ref' => '#/$defs/path-item-or-reference'
|
140
|
+
}
|
141
|
+
},
|
142
|
+
'components' => {
|
143
|
+
'$ref' => '#/$defs/components'
|
144
|
+
},
|
145
|
+
'security' => {
|
146
|
+
'type' => 'array',
|
147
|
+
'items' => {
|
148
|
+
'$ref' => '#/$defs/security-requirement'
|
149
|
+
}
|
150
|
+
},
|
151
|
+
'tags' => {
|
152
|
+
'type' => 'array',
|
153
|
+
'items' => {
|
154
|
+
'$ref' => '#/$defs/tag'
|
155
|
+
}
|
156
|
+
},
|
157
|
+
'externalDocs' => {
|
158
|
+
'$ref' => '#/$defs/external-documentation'
|
159
|
+
}
|
160
|
+
},
|
161
|
+
'required' => [
|
162
|
+
'openapi',
|
163
|
+
'info'
|
164
|
+
],
|
165
|
+
'anyOf' => [
|
166
|
+
{
|
167
|
+
'required' => [
|
168
|
+
'paths'
|
169
|
+
]
|
170
|
+
},
|
171
|
+
{
|
172
|
+
'required' => [
|
173
|
+
'components'
|
174
|
+
]
|
175
|
+
},
|
176
|
+
{
|
177
|
+
'required' => [
|
178
|
+
'webhooks'
|
179
|
+
]
|
180
|
+
}
|
181
|
+
],
|
182
|
+
'$ref' => '#/$defs/specification-extensions',
|
183
|
+
'unevaluatedProperties' => false,
|
184
|
+
'$defs' => {
|
185
|
+
'info' => {
|
186
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#info-object',
|
187
|
+
'type' => 'object',
|
188
|
+
'properties' => {
|
189
|
+
'title' => {
|
190
|
+
'type' => 'string'
|
191
|
+
},
|
192
|
+
'summary' => {
|
193
|
+
'type' => 'string'
|
194
|
+
},
|
195
|
+
'description' => {
|
196
|
+
'type' => 'string'
|
197
|
+
},
|
198
|
+
'termsOfService' => {
|
199
|
+
'type' => 'string',
|
200
|
+
'format' => 'uri'
|
201
|
+
},
|
202
|
+
'contact' => {
|
203
|
+
'$ref' => '#/$defs/contact'
|
204
|
+
},
|
205
|
+
'license' => {
|
206
|
+
'$ref' => '#/$defs/license'
|
207
|
+
},
|
208
|
+
'version' => {
|
209
|
+
'type' => 'string'
|
210
|
+
}
|
211
|
+
},
|
212
|
+
'required' => [
|
213
|
+
'title',
|
214
|
+
'version'
|
215
|
+
],
|
216
|
+
'$ref' => '#/$defs/specification-extensions',
|
217
|
+
'unevaluatedProperties' => false
|
218
|
+
},
|
219
|
+
'contact' => {
|
220
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#contact-object',
|
221
|
+
'type' => 'object',
|
222
|
+
'properties' => {
|
223
|
+
'name' => {
|
224
|
+
'type' => 'string'
|
225
|
+
},
|
226
|
+
'url' => {
|
227
|
+
'type' => 'string',
|
228
|
+
'format' => 'uri'
|
229
|
+
},
|
230
|
+
'email' => {
|
231
|
+
'type' => 'string',
|
232
|
+
'format' => 'email'
|
233
|
+
}
|
234
|
+
},
|
235
|
+
'$ref' => '#/$defs/specification-extensions',
|
236
|
+
'unevaluatedProperties' => false
|
237
|
+
},
|
238
|
+
'license' => {
|
239
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#license-object',
|
240
|
+
'type' => 'object',
|
241
|
+
'properties' => {
|
242
|
+
'name' => {
|
243
|
+
'type' => 'string'
|
244
|
+
},
|
245
|
+
'identifier' => {
|
246
|
+
'type' => 'string'
|
247
|
+
},
|
248
|
+
'url' => {
|
249
|
+
'type' => 'string',
|
250
|
+
'format' => 'uri'
|
251
|
+
}
|
252
|
+
},
|
253
|
+
'required' => [
|
254
|
+
'name'
|
255
|
+
],
|
256
|
+
'dependentSchemas' => {
|
257
|
+
'identifier' => {
|
258
|
+
'not' => {
|
259
|
+
'required' => [
|
260
|
+
'url'
|
261
|
+
]
|
262
|
+
}
|
263
|
+
}
|
264
|
+
},
|
265
|
+
'$ref' => '#/$defs/specification-extensions',
|
266
|
+
'unevaluatedProperties' => false
|
267
|
+
},
|
268
|
+
'server' => {
|
269
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#server-object',
|
270
|
+
'type' => 'object',
|
271
|
+
'properties' => {
|
272
|
+
'url' => {
|
273
|
+
'type' => 'string'
|
274
|
+
},
|
275
|
+
'description' => {
|
276
|
+
'type' => 'string'
|
277
|
+
},
|
278
|
+
'variables' => {
|
279
|
+
'type' => 'object',
|
280
|
+
'additionalProperties' => {
|
281
|
+
'$ref' => '#/$defs/server-variable'
|
282
|
+
}
|
283
|
+
}
|
284
|
+
},
|
285
|
+
'required' => [
|
286
|
+
'url'
|
287
|
+
],
|
288
|
+
'$ref' => '#/$defs/specification-extensions',
|
289
|
+
'unevaluatedProperties' => false
|
290
|
+
},
|
291
|
+
'server-variable' => {
|
292
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#server-variable-object',
|
293
|
+
'type' => 'object',
|
294
|
+
'properties' => {
|
295
|
+
'enum' => {
|
296
|
+
'type' => 'array',
|
297
|
+
'items' => {
|
298
|
+
'type' => 'string'
|
299
|
+
},
|
300
|
+
'minItems' => 1
|
301
|
+
},
|
302
|
+
'default' => {
|
303
|
+
'type' => 'string'
|
304
|
+
},
|
305
|
+
'description' => {
|
306
|
+
'type' => 'string'
|
307
|
+
}
|
308
|
+
},
|
309
|
+
'required' => [
|
310
|
+
'default'
|
311
|
+
],
|
312
|
+
'$ref' => '#/$defs/specification-extensions',
|
313
|
+
'unevaluatedProperties' => false
|
314
|
+
},
|
315
|
+
'components' => {
|
316
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#components-object',
|
317
|
+
'type' => 'object',
|
318
|
+
'properties' => {
|
319
|
+
'schemas' => {
|
320
|
+
'type' => 'object',
|
321
|
+
'additionalProperties' => {
|
322
|
+
'$dynamicRef' => '#meta'
|
323
|
+
}
|
324
|
+
},
|
325
|
+
'responses' => {
|
326
|
+
'type' => 'object',
|
327
|
+
'additionalProperties' => {
|
328
|
+
'$ref' => '#/$defs/response-or-reference'
|
329
|
+
}
|
330
|
+
},
|
331
|
+
'parameters' => {
|
332
|
+
'type' => 'object',
|
333
|
+
'additionalProperties' => {
|
334
|
+
'$ref' => '#/$defs/parameter-or-reference'
|
335
|
+
}
|
336
|
+
},
|
337
|
+
'examples' => {
|
338
|
+
'type' => 'object',
|
339
|
+
'additionalProperties' => {
|
340
|
+
'$ref' => '#/$defs/example-or-reference'
|
341
|
+
}
|
342
|
+
},
|
343
|
+
'requestBodies' => {
|
344
|
+
'type' => 'object',
|
345
|
+
'additionalProperties' => {
|
346
|
+
'$ref' => '#/$defs/request-body-or-reference'
|
347
|
+
}
|
348
|
+
},
|
349
|
+
'headers' => {
|
350
|
+
'type' => 'object',
|
351
|
+
'additionalProperties' => {
|
352
|
+
'$ref' => '#/$defs/header-or-reference'
|
353
|
+
}
|
354
|
+
},
|
355
|
+
'securitySchemes' => {
|
356
|
+
'type' => 'object',
|
357
|
+
'additionalProperties' => {
|
358
|
+
'$ref' => '#/$defs/security-scheme-or-reference'
|
359
|
+
}
|
360
|
+
},
|
361
|
+
'links' => {
|
362
|
+
'type' => 'object',
|
363
|
+
'additionalProperties' => {
|
364
|
+
'$ref' => '#/$defs/link-or-reference'
|
365
|
+
}
|
366
|
+
},
|
367
|
+
'callbacks' => {
|
368
|
+
'type' => 'object',
|
369
|
+
'additionalProperties' => {
|
370
|
+
'$ref' => '#/$defs/callbacks-or-reference'
|
371
|
+
}
|
372
|
+
},
|
373
|
+
'pathItems' => {
|
374
|
+
'type' => 'object',
|
375
|
+
'additionalProperties' => {
|
376
|
+
'$ref' => '#/$defs/path-item-or-reference'
|
377
|
+
}
|
378
|
+
}
|
379
|
+
},
|
380
|
+
'patternProperties' => {
|
381
|
+
'^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$' => {
|
382
|
+
'$comment' => 'Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected',
|
383
|
+
'propertyNames' => {
|
384
|
+
'pattern' => '^[a-zA-Z0-9._-]+$'
|
385
|
+
}
|
386
|
+
}
|
387
|
+
},
|
388
|
+
'$ref' => '#/$defs/specification-extensions',
|
389
|
+
'unevaluatedProperties' => false
|
390
|
+
},
|
391
|
+
'paths' => {
|
392
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#paths-object',
|
393
|
+
'type' => 'object',
|
394
|
+
'patternProperties' => {
|
395
|
+
'^/' => {
|
396
|
+
'$ref' => '#/$defs/path-item'
|
397
|
+
}
|
398
|
+
},
|
399
|
+
'$ref' => '#/$defs/specification-extensions',
|
400
|
+
'unevaluatedProperties' => false
|
401
|
+
},
|
402
|
+
'path-item' => {
|
403
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#path-item-object',
|
404
|
+
'type' => 'object',
|
405
|
+
'properties' => {
|
406
|
+
'summary' => {
|
407
|
+
'type' => 'string'
|
408
|
+
},
|
409
|
+
'description' => {
|
410
|
+
'type' => 'string'
|
411
|
+
},
|
412
|
+
'servers' => {
|
413
|
+
'type' => 'array',
|
414
|
+
'items' => {
|
415
|
+
'$ref' => '#/$defs/server'
|
416
|
+
}
|
417
|
+
},
|
418
|
+
'parameters' => {
|
419
|
+
'type' => 'array',
|
420
|
+
'items' => {
|
421
|
+
'$ref' => '#/$defs/parameter-or-reference'
|
422
|
+
}
|
423
|
+
},
|
424
|
+
'get' => {
|
425
|
+
'$ref' => '#/$defs/operation'
|
426
|
+
},
|
427
|
+
'put' => {
|
428
|
+
'$ref' => '#/$defs/operation'
|
429
|
+
},
|
430
|
+
'post' => {
|
431
|
+
'$ref' => '#/$defs/operation'
|
432
|
+
},
|
433
|
+
'delete' => {
|
434
|
+
'$ref' => '#/$defs/operation'
|
435
|
+
},
|
436
|
+
'options' => {
|
437
|
+
'$ref' => '#/$defs/operation'
|
438
|
+
},
|
439
|
+
'head' => {
|
440
|
+
'$ref' => '#/$defs/operation'
|
441
|
+
},
|
442
|
+
'patch' => {
|
443
|
+
'$ref' => '#/$defs/operation'
|
444
|
+
},
|
445
|
+
'trace' => {
|
446
|
+
'$ref' => '#/$defs/operation'
|
447
|
+
}
|
448
|
+
},
|
449
|
+
'$ref' => '#/$defs/specification-extensions',
|
450
|
+
'unevaluatedProperties' => false
|
451
|
+
},
|
452
|
+
'path-item-or-reference' => {
|
453
|
+
'if' => {
|
454
|
+
'type' => 'object',
|
455
|
+
'required' => [
|
456
|
+
'$ref'
|
457
|
+
]
|
458
|
+
},
|
459
|
+
'then' => {
|
460
|
+
'$ref' => '#/$defs/reference'
|
461
|
+
},
|
462
|
+
'else' => {
|
463
|
+
'$ref' => '#/$defs/path-item'
|
464
|
+
}
|
465
|
+
},
|
466
|
+
'operation' => {
|
467
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#operation-object',
|
468
|
+
'type' => 'object',
|
469
|
+
'properties' => {
|
470
|
+
'tags' => {
|
471
|
+
'type' => 'array',
|
472
|
+
'items' => {
|
473
|
+
'type' => 'string'
|
474
|
+
}
|
475
|
+
},
|
476
|
+
'summary' => {
|
477
|
+
'type' => 'string'
|
478
|
+
},
|
479
|
+
'description' => {
|
480
|
+
'type' => 'string'
|
481
|
+
},
|
482
|
+
'externalDocs' => {
|
483
|
+
'$ref' => '#/$defs/external-documentation'
|
484
|
+
},
|
485
|
+
'operationId' => {
|
486
|
+
'type' => 'string'
|
487
|
+
},
|
488
|
+
'parameters' => {
|
489
|
+
'type' => 'array',
|
490
|
+
'items' => {
|
491
|
+
'$ref' => '#/$defs/parameter-or-reference'
|
492
|
+
}
|
493
|
+
},
|
494
|
+
'requestBody' => {
|
495
|
+
'$ref' => '#/$defs/request-body-or-reference'
|
496
|
+
},
|
497
|
+
'responses' => {
|
498
|
+
'$ref' => '#/$defs/responses'
|
499
|
+
},
|
500
|
+
'callbacks' => {
|
501
|
+
'type' => 'object',
|
502
|
+
'additionalProperties' => {
|
503
|
+
'$ref' => '#/$defs/callbacks-or-reference'
|
504
|
+
}
|
505
|
+
},
|
506
|
+
'deprecated' => {
|
507
|
+
'default' => false,
|
508
|
+
'type' => 'boolean'
|
509
|
+
},
|
510
|
+
'security' => {
|
511
|
+
'type' => 'array',
|
512
|
+
'items' => {
|
513
|
+
'$ref' => '#/$defs/security-requirement'
|
514
|
+
}
|
515
|
+
},
|
516
|
+
'servers' => {
|
517
|
+
'type' => 'array',
|
518
|
+
'items' => {
|
519
|
+
'$ref' => '#/$defs/server'
|
520
|
+
}
|
521
|
+
}
|
522
|
+
},
|
523
|
+
'$ref' => '#/$defs/specification-extensions',
|
524
|
+
'unevaluatedProperties' => false
|
525
|
+
},
|
526
|
+
'external-documentation' => {
|
527
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#external-documentation-object',
|
528
|
+
'type' => 'object',
|
529
|
+
'properties' => {
|
530
|
+
'description' => {
|
531
|
+
'type' => 'string'
|
532
|
+
},
|
533
|
+
'url' => {
|
534
|
+
'type' => 'string',
|
535
|
+
'format' => 'uri'
|
536
|
+
}
|
537
|
+
},
|
538
|
+
'required' => [
|
539
|
+
'url'
|
540
|
+
],
|
541
|
+
'$ref' => '#/$defs/specification-extensions',
|
542
|
+
'unevaluatedProperties' => false
|
543
|
+
},
|
544
|
+
'parameter' => {
|
545
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#parameter-object',
|
546
|
+
'type' => 'object',
|
547
|
+
'properties' => {
|
548
|
+
'name' => {
|
549
|
+
'type' => 'string'
|
550
|
+
},
|
551
|
+
'in' => {
|
552
|
+
'enum' => [
|
553
|
+
'query',
|
554
|
+
'header',
|
555
|
+
'path',
|
556
|
+
'cookie'
|
557
|
+
]
|
558
|
+
},
|
559
|
+
'description' => {
|
560
|
+
'type' => 'string'
|
561
|
+
},
|
562
|
+
'required' => {
|
563
|
+
'default' => false,
|
564
|
+
'type' => 'boolean'
|
565
|
+
},
|
566
|
+
'deprecated' => {
|
567
|
+
'default' => false,
|
568
|
+
'type' => 'boolean'
|
569
|
+
},
|
570
|
+
'schema' => {
|
571
|
+
'$dynamicRef' => '#meta'
|
572
|
+
},
|
573
|
+
'content' => {
|
574
|
+
'$ref' => '#/$defs/content',
|
575
|
+
'minProperties' => 1,
|
576
|
+
'maxProperties' => 1
|
577
|
+
}
|
578
|
+
},
|
579
|
+
'required' => [
|
580
|
+
'name',
|
581
|
+
'in'
|
582
|
+
],
|
583
|
+
'oneOf' => [
|
584
|
+
{
|
585
|
+
'required' => [
|
586
|
+
'schema'
|
587
|
+
]
|
588
|
+
},
|
589
|
+
{
|
590
|
+
'required' => [
|
591
|
+
'content'
|
592
|
+
]
|
593
|
+
}
|
594
|
+
],
|
595
|
+
'if' => {
|
596
|
+
'properties' => {
|
597
|
+
'in' => {
|
598
|
+
'const' => 'query'
|
599
|
+
}
|
600
|
+
},
|
601
|
+
'required' => [
|
602
|
+
'in'
|
603
|
+
]
|
604
|
+
},
|
605
|
+
'then' => {
|
606
|
+
'properties' => {
|
607
|
+
'allowEmptyValue' => {
|
608
|
+
'default' => false,
|
609
|
+
'type' => 'boolean'
|
610
|
+
}
|
611
|
+
}
|
612
|
+
},
|
613
|
+
'dependentSchemas' => {
|
614
|
+
'schema' => {
|
615
|
+
'properties' => {
|
616
|
+
'style' => {
|
617
|
+
'type' => 'string'
|
618
|
+
},
|
619
|
+
'explode' => {
|
620
|
+
'type' => 'boolean'
|
621
|
+
}
|
622
|
+
},
|
623
|
+
'allOf' => [
|
624
|
+
{
|
625
|
+
'$ref' => '#/$defs/examples'
|
626
|
+
},
|
627
|
+
{
|
628
|
+
'$ref' => '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path'
|
629
|
+
},
|
630
|
+
{
|
631
|
+
'$ref' => '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header'
|
632
|
+
},
|
633
|
+
{
|
634
|
+
'$ref' => '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query'
|
635
|
+
},
|
636
|
+
{
|
637
|
+
'$ref' => '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie'
|
638
|
+
},
|
639
|
+
{
|
640
|
+
'$ref' => '#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-form'
|
641
|
+
}
|
642
|
+
],
|
643
|
+
'$defs' => {
|
644
|
+
'styles-for-path' => {
|
645
|
+
'if' => {
|
646
|
+
'properties' => {
|
647
|
+
'in' => {
|
648
|
+
'const' => 'path'
|
649
|
+
}
|
650
|
+
},
|
651
|
+
'required' => [
|
652
|
+
'in'
|
653
|
+
]
|
654
|
+
},
|
655
|
+
'then' => {
|
656
|
+
'properties' => {
|
657
|
+
'name' => {
|
658
|
+
'pattern' => '[^/#?]+$'
|
659
|
+
},
|
660
|
+
'style' => {
|
661
|
+
'default' => 'simple',
|
662
|
+
'enum' => [
|
663
|
+
'matrix',
|
664
|
+
'label',
|
665
|
+
'simple'
|
666
|
+
]
|
667
|
+
},
|
668
|
+
'required' => {
|
669
|
+
'const' => true
|
670
|
+
}
|
671
|
+
},
|
672
|
+
'required' => [
|
673
|
+
'required'
|
674
|
+
]
|
675
|
+
}
|
676
|
+
},
|
677
|
+
'styles-for-header' => {
|
678
|
+
'if' => {
|
679
|
+
'properties' => {
|
680
|
+
'in' => {
|
681
|
+
'const' => 'header'
|
682
|
+
}
|
683
|
+
},
|
684
|
+
'required' => [
|
685
|
+
'in'
|
686
|
+
]
|
687
|
+
},
|
688
|
+
'then' => {
|
689
|
+
'properties' => {
|
690
|
+
'style' => {
|
691
|
+
'default' => 'simple',
|
692
|
+
'const' => 'simple'
|
693
|
+
}
|
694
|
+
}
|
695
|
+
}
|
696
|
+
},
|
697
|
+
'styles-for-query' => {
|
698
|
+
'if' => {
|
699
|
+
'properties' => {
|
700
|
+
'in' => {
|
701
|
+
'const' => 'query'
|
702
|
+
}
|
703
|
+
},
|
704
|
+
'required' => [
|
705
|
+
'in'
|
706
|
+
]
|
707
|
+
},
|
708
|
+
'then' => {
|
709
|
+
'properties' => {
|
710
|
+
'style' => {
|
711
|
+
'default' => 'form',
|
712
|
+
'enum' => [
|
713
|
+
'form',
|
714
|
+
'spaceDelimited',
|
715
|
+
'pipeDelimited',
|
716
|
+
'deepObject'
|
717
|
+
]
|
718
|
+
},
|
719
|
+
'allowReserved' => {
|
720
|
+
'default' => false,
|
721
|
+
'type' => 'boolean'
|
722
|
+
}
|
723
|
+
}
|
724
|
+
}
|
725
|
+
},
|
726
|
+
'styles-for-cookie' => {
|
727
|
+
'if' => {
|
728
|
+
'properties' => {
|
729
|
+
'in' => {
|
730
|
+
'const' => 'cookie'
|
731
|
+
}
|
732
|
+
},
|
733
|
+
'required' => [
|
734
|
+
'in'
|
735
|
+
]
|
736
|
+
},
|
737
|
+
'then' => {
|
738
|
+
'properties' => {
|
739
|
+
'style' => {
|
740
|
+
'default' => 'form',
|
741
|
+
'const' => 'form'
|
742
|
+
}
|
743
|
+
}
|
744
|
+
}
|
745
|
+
},
|
746
|
+
'styles-for-form' => {
|
747
|
+
'if' => {
|
748
|
+
'properties' => {
|
749
|
+
'style' => {
|
750
|
+
'const' => 'form'
|
751
|
+
}
|
752
|
+
},
|
753
|
+
'required' => [
|
754
|
+
'style'
|
755
|
+
]
|
756
|
+
},
|
757
|
+
'then' => {
|
758
|
+
'properties' => {
|
759
|
+
'explode' => {
|
760
|
+
'default' => true
|
761
|
+
}
|
762
|
+
}
|
763
|
+
},
|
764
|
+
'else' => {
|
765
|
+
'properties' => {
|
766
|
+
'explode' => {
|
767
|
+
'default' => false
|
768
|
+
}
|
769
|
+
}
|
770
|
+
}
|
771
|
+
}
|
772
|
+
}
|
773
|
+
}
|
774
|
+
},
|
775
|
+
'$ref' => '#/$defs/specification-extensions',
|
776
|
+
'unevaluatedProperties' => false
|
777
|
+
},
|
778
|
+
'parameter-or-reference' => {
|
779
|
+
'if' => {
|
780
|
+
'type' => 'object',
|
781
|
+
'required' => [
|
782
|
+
'$ref'
|
783
|
+
]
|
784
|
+
},
|
785
|
+
'then' => {
|
786
|
+
'$ref' => '#/$defs/reference'
|
787
|
+
},
|
788
|
+
'else' => {
|
789
|
+
'$ref' => '#/$defs/parameter'
|
790
|
+
}
|
791
|
+
},
|
792
|
+
'request-body' => {
|
793
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#request-body-object',
|
794
|
+
'type' => 'object',
|
795
|
+
'properties' => {
|
796
|
+
'description' => {
|
797
|
+
'type' => 'string'
|
798
|
+
},
|
799
|
+
'content' => {
|
800
|
+
'$ref' => '#/$defs/content'
|
801
|
+
},
|
802
|
+
'required' => {
|
803
|
+
'default' => false,
|
804
|
+
'type' => 'boolean'
|
805
|
+
}
|
806
|
+
},
|
807
|
+
'required' => [
|
808
|
+
'content'
|
809
|
+
],
|
810
|
+
'$ref' => '#/$defs/specification-extensions',
|
811
|
+
'unevaluatedProperties' => false
|
812
|
+
},
|
813
|
+
'request-body-or-reference' => {
|
814
|
+
'if' => {
|
815
|
+
'type' => 'object',
|
816
|
+
'required' => [
|
817
|
+
'$ref'
|
818
|
+
]
|
819
|
+
},
|
820
|
+
'then' => {
|
821
|
+
'$ref' => '#/$defs/reference'
|
822
|
+
},
|
823
|
+
'else' => {
|
824
|
+
'$ref' => '#/$defs/request-body'
|
825
|
+
}
|
826
|
+
},
|
827
|
+
'content' => {
|
828
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#fixed-fields-10',
|
829
|
+
'type' => 'object',
|
830
|
+
'additionalProperties' => {
|
831
|
+
'$ref' => '#/$defs/media-type'
|
832
|
+
},
|
833
|
+
'propertyNames' => {
|
834
|
+
'format' => 'media-range'
|
835
|
+
}
|
836
|
+
},
|
837
|
+
'media-type' => {
|
838
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#media-type-object',
|
839
|
+
'type' => 'object',
|
840
|
+
'properties' => {
|
841
|
+
'schema' => {
|
842
|
+
'$dynamicRef' => '#meta'
|
843
|
+
},
|
844
|
+
'encoding' => {
|
845
|
+
'type' => 'object',
|
846
|
+
'additionalProperties' => {
|
847
|
+
'$ref' => '#/$defs/encoding'
|
848
|
+
}
|
849
|
+
}
|
850
|
+
},
|
851
|
+
'allOf' => [
|
852
|
+
{
|
853
|
+
'$ref' => '#/$defs/specification-extensions'
|
854
|
+
},
|
855
|
+
{
|
856
|
+
'$ref' => '#/$defs/examples'
|
857
|
+
}
|
858
|
+
],
|
859
|
+
'unevaluatedProperties' => false
|
860
|
+
},
|
861
|
+
'encoding' => {
|
862
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#encoding-object',
|
863
|
+
'type' => 'object',
|
864
|
+
'properties' => {
|
865
|
+
'contentType' => {
|
866
|
+
'type' => 'string',
|
867
|
+
'format' => 'media-range'
|
868
|
+
},
|
869
|
+
'headers' => {
|
870
|
+
'type' => 'object',
|
871
|
+
'additionalProperties' => {
|
872
|
+
'$ref' => '#/$defs/header-or-reference'
|
873
|
+
}
|
874
|
+
},
|
875
|
+
'style' => {
|
876
|
+
'default' => 'form',
|
877
|
+
'enum' => [
|
878
|
+
'form',
|
879
|
+
'spaceDelimited',
|
880
|
+
'pipeDelimited',
|
881
|
+
'deepObject'
|
882
|
+
]
|
883
|
+
},
|
884
|
+
'explode' => {
|
885
|
+
'type' => 'boolean'
|
886
|
+
},
|
887
|
+
'allowReserved' => {
|
888
|
+
'default' => false,
|
889
|
+
'type' => 'boolean'
|
890
|
+
}
|
891
|
+
},
|
892
|
+
'allOf' => [
|
893
|
+
{
|
894
|
+
'$ref' => '#/$defs/specification-extensions'
|
895
|
+
},
|
896
|
+
{
|
897
|
+
'$ref' => '#/$defs/encoding/$defs/explode-default'
|
898
|
+
}
|
899
|
+
],
|
900
|
+
'unevaluatedProperties' => false,
|
901
|
+
'$defs' => {
|
902
|
+
'explode-default' => {
|
903
|
+
'if' => {
|
904
|
+
'properties' => {
|
905
|
+
'style' => {
|
906
|
+
'const' => 'form'
|
907
|
+
}
|
908
|
+
},
|
909
|
+
'required' => [
|
910
|
+
'style'
|
911
|
+
]
|
912
|
+
},
|
913
|
+
'then' => {
|
914
|
+
'properties' => {
|
915
|
+
'explode' => {
|
916
|
+
'default' => true
|
917
|
+
}
|
918
|
+
}
|
919
|
+
},
|
920
|
+
'else' => {
|
921
|
+
'properties' => {
|
922
|
+
'explode' => {
|
923
|
+
'default' => false
|
924
|
+
}
|
925
|
+
}
|
926
|
+
}
|
927
|
+
}
|
928
|
+
}
|
929
|
+
},
|
930
|
+
'responses' => {
|
931
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#responses-object',
|
932
|
+
'type' => 'object',
|
933
|
+
'properties' => {
|
934
|
+
'default' => {
|
935
|
+
'$ref' => '#/$defs/response-or-reference'
|
936
|
+
}
|
937
|
+
},
|
938
|
+
'patternProperties' => {
|
939
|
+
'^[1-5](?:[0-9]{2}|XX)$' => {
|
940
|
+
'$ref' => '#/$defs/response-or-reference'
|
941
|
+
}
|
942
|
+
},
|
943
|
+
'minProperties' => 1,
|
944
|
+
'$ref' => '#/$defs/specification-extensions',
|
945
|
+
'unevaluatedProperties' => false
|
946
|
+
},
|
947
|
+
'response' => {
|
948
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#response-object',
|
949
|
+
'type' => 'object',
|
950
|
+
'properties' => {
|
951
|
+
'description' => {
|
952
|
+
'type' => 'string'
|
953
|
+
},
|
954
|
+
'headers' => {
|
955
|
+
'type' => 'object',
|
956
|
+
'additionalProperties' => {
|
957
|
+
'$ref' => '#/$defs/header-or-reference'
|
958
|
+
}
|
959
|
+
},
|
960
|
+
'content' => {
|
961
|
+
'$ref' => '#/$defs/content'
|
962
|
+
},
|
963
|
+
'links' => {
|
964
|
+
'type' => 'object',
|
965
|
+
'additionalProperties' => {
|
966
|
+
'$ref' => '#/$defs/link-or-reference'
|
967
|
+
}
|
968
|
+
}
|
969
|
+
},
|
970
|
+
'required' => [
|
971
|
+
'description'
|
972
|
+
],
|
973
|
+
'$ref' => '#/$defs/specification-extensions',
|
974
|
+
'unevaluatedProperties' => false
|
975
|
+
},
|
976
|
+
'response-or-reference' => {
|
977
|
+
'if' => {
|
978
|
+
'type' => 'object',
|
979
|
+
'required' => [
|
980
|
+
'$ref'
|
981
|
+
]
|
982
|
+
},
|
983
|
+
'then' => {
|
984
|
+
'$ref' => '#/$defs/reference'
|
985
|
+
},
|
986
|
+
'else' => {
|
987
|
+
'$ref' => '#/$defs/response'
|
988
|
+
}
|
989
|
+
},
|
990
|
+
'callbacks' => {
|
991
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#callback-object',
|
992
|
+
'type' => 'object',
|
993
|
+
'$ref' => '#/$defs/specification-extensions',
|
994
|
+
'additionalProperties' => {
|
995
|
+
'$ref' => '#/$defs/path-item-or-reference'
|
996
|
+
}
|
997
|
+
},
|
998
|
+
'callbacks-or-reference' => {
|
999
|
+
'if' => {
|
1000
|
+
'type' => 'object',
|
1001
|
+
'required' => [
|
1002
|
+
'$ref'
|
1003
|
+
]
|
1004
|
+
},
|
1005
|
+
'then' => {
|
1006
|
+
'$ref' => '#/$defs/reference'
|
1007
|
+
},
|
1008
|
+
'else' => {
|
1009
|
+
'$ref' => '#/$defs/callbacks'
|
1010
|
+
}
|
1011
|
+
},
|
1012
|
+
'example' => {
|
1013
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#example-object',
|
1014
|
+
'type' => 'object',
|
1015
|
+
'properties' => {
|
1016
|
+
'summary' => {
|
1017
|
+
'type' => 'string'
|
1018
|
+
},
|
1019
|
+
'description' => {
|
1020
|
+
'type' => 'string'
|
1021
|
+
},
|
1022
|
+
'value' => true,
|
1023
|
+
'externalValue' => {
|
1024
|
+
'type' => 'string',
|
1025
|
+
'format' => 'uri'
|
1026
|
+
}
|
1027
|
+
},
|
1028
|
+
'not' => {
|
1029
|
+
'required' => [
|
1030
|
+
'value',
|
1031
|
+
'externalValue'
|
1032
|
+
]
|
1033
|
+
},
|
1034
|
+
'$ref' => '#/$defs/specification-extensions',
|
1035
|
+
'unevaluatedProperties' => false
|
1036
|
+
},
|
1037
|
+
'example-or-reference' => {
|
1038
|
+
'if' => {
|
1039
|
+
'type' => 'object',
|
1040
|
+
'required' => [
|
1041
|
+
'$ref'
|
1042
|
+
]
|
1043
|
+
},
|
1044
|
+
'then' => {
|
1045
|
+
'$ref' => '#/$defs/reference'
|
1046
|
+
},
|
1047
|
+
'else' => {
|
1048
|
+
'$ref' => '#/$defs/example'
|
1049
|
+
}
|
1050
|
+
},
|
1051
|
+
'link' => {
|
1052
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#link-object',
|
1053
|
+
'type' => 'object',
|
1054
|
+
'properties' => {
|
1055
|
+
'operationRef' => {
|
1056
|
+
'type' => 'string'
|
1057
|
+
},
|
1058
|
+
'operationId' => {
|
1059
|
+
'type' => 'string'
|
1060
|
+
},
|
1061
|
+
'parameters' => {
|
1062
|
+
'$ref' => '#/$defs/map-of-strings'
|
1063
|
+
},
|
1064
|
+
'requestBody' => true,
|
1065
|
+
'description' => {
|
1066
|
+
'type' => 'string'
|
1067
|
+
},
|
1068
|
+
'body' => {
|
1069
|
+
'$ref' => '#/$defs/server'
|
1070
|
+
}
|
1071
|
+
},
|
1072
|
+
'oneOf' => [
|
1073
|
+
{
|
1074
|
+
'required' => [
|
1075
|
+
'operationRef'
|
1076
|
+
]
|
1077
|
+
},
|
1078
|
+
{
|
1079
|
+
'required' => [
|
1080
|
+
'operationId'
|
1081
|
+
]
|
1082
|
+
}
|
1083
|
+
],
|
1084
|
+
'$ref' => '#/$defs/specification-extensions',
|
1085
|
+
'unevaluatedProperties' => false
|
1086
|
+
},
|
1087
|
+
'link-or-reference' => {
|
1088
|
+
'if' => {
|
1089
|
+
'type' => 'object',
|
1090
|
+
'required' => [
|
1091
|
+
'$ref'
|
1092
|
+
]
|
1093
|
+
},
|
1094
|
+
'then' => {
|
1095
|
+
'$ref' => '#/$defs/reference'
|
1096
|
+
},
|
1097
|
+
'else' => {
|
1098
|
+
'$ref' => '#/$defs/link'
|
1099
|
+
}
|
1100
|
+
},
|
1101
|
+
'header' => {
|
1102
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#header-object',
|
1103
|
+
'type' => 'object',
|
1104
|
+
'properties' => {
|
1105
|
+
'description' => {
|
1106
|
+
'type' => 'string'
|
1107
|
+
},
|
1108
|
+
'required' => {
|
1109
|
+
'default' => false,
|
1110
|
+
'type' => 'boolean'
|
1111
|
+
},
|
1112
|
+
'deprecated' => {
|
1113
|
+
'default' => false,
|
1114
|
+
'type' => 'boolean'
|
1115
|
+
},
|
1116
|
+
'schema' => {
|
1117
|
+
'$dynamicRef' => '#meta'
|
1118
|
+
},
|
1119
|
+
'content' => {
|
1120
|
+
'$ref' => '#/$defs/content',
|
1121
|
+
'minProperties' => 1,
|
1122
|
+
'maxProperties' => 1
|
1123
|
+
}
|
1124
|
+
},
|
1125
|
+
'oneOf' => [
|
1126
|
+
{
|
1127
|
+
'required' => [
|
1128
|
+
'schema'
|
1129
|
+
]
|
1130
|
+
},
|
1131
|
+
{
|
1132
|
+
'required' => [
|
1133
|
+
'content'
|
1134
|
+
]
|
1135
|
+
}
|
1136
|
+
],
|
1137
|
+
'dependentSchemas' => {
|
1138
|
+
'schema' => {
|
1139
|
+
'properties' => {
|
1140
|
+
'style' => {
|
1141
|
+
'default' => 'simple',
|
1142
|
+
'const' => 'simple'
|
1143
|
+
},
|
1144
|
+
'explode' => {
|
1145
|
+
'default' => false,
|
1146
|
+
'type' => 'boolean'
|
1147
|
+
}
|
1148
|
+
},
|
1149
|
+
'$ref' => '#/$defs/examples'
|
1150
|
+
}
|
1151
|
+
},
|
1152
|
+
'$ref' => '#/$defs/specification-extensions',
|
1153
|
+
'unevaluatedProperties' => false
|
1154
|
+
},
|
1155
|
+
'header-or-reference' => {
|
1156
|
+
'if' => {
|
1157
|
+
'type' => 'object',
|
1158
|
+
'required' => [
|
1159
|
+
'$ref'
|
1160
|
+
]
|
1161
|
+
},
|
1162
|
+
'then' => {
|
1163
|
+
'$ref' => '#/$defs/reference'
|
1164
|
+
},
|
1165
|
+
'else' => {
|
1166
|
+
'$ref' => '#/$defs/header'
|
1167
|
+
}
|
1168
|
+
},
|
1169
|
+
'tag' => {
|
1170
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#tag-object',
|
1171
|
+
'type' => 'object',
|
1172
|
+
'properties' => {
|
1173
|
+
'name' => {
|
1174
|
+
'type' => 'string'
|
1175
|
+
},
|
1176
|
+
'description' => {
|
1177
|
+
'type' => 'string'
|
1178
|
+
},
|
1179
|
+
'externalDocs' => {
|
1180
|
+
'$ref' => '#/$defs/external-documentation'
|
1181
|
+
}
|
1182
|
+
},
|
1183
|
+
'required' => [
|
1184
|
+
'name'
|
1185
|
+
],
|
1186
|
+
'$ref' => '#/$defs/specification-extensions',
|
1187
|
+
'unevaluatedProperties' => false
|
1188
|
+
},
|
1189
|
+
'reference' => {
|
1190
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#reference-object',
|
1191
|
+
'type' => 'object',
|
1192
|
+
'properties' => {
|
1193
|
+
'$ref' => {
|
1194
|
+
'type' => 'string',
|
1195
|
+
'format' => 'uri-reference'
|
1196
|
+
},
|
1197
|
+
'summary' => {
|
1198
|
+
'type' => 'string'
|
1199
|
+
},
|
1200
|
+
'description' => {
|
1201
|
+
'type' => 'string'
|
1202
|
+
}
|
1203
|
+
},
|
1204
|
+
'unevaluatedProperties' => false
|
1205
|
+
},
|
1206
|
+
'schema' => {
|
1207
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#schema-object',
|
1208
|
+
'$dynamicAnchor' => 'meta',
|
1209
|
+
'type' => [
|
1210
|
+
'object',
|
1211
|
+
'boolean'
|
1212
|
+
]
|
1213
|
+
},
|
1214
|
+
'security-scheme' => {
|
1215
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#security-scheme-object',
|
1216
|
+
'type' => 'object',
|
1217
|
+
'properties' => {
|
1218
|
+
'type' => {
|
1219
|
+
'enum' => [
|
1220
|
+
'apiKey',
|
1221
|
+
'http',
|
1222
|
+
'mutualTLS',
|
1223
|
+
'oauth2',
|
1224
|
+
'openIdConnect'
|
1225
|
+
]
|
1226
|
+
},
|
1227
|
+
'description' => {
|
1228
|
+
'type' => 'string'
|
1229
|
+
}
|
1230
|
+
},
|
1231
|
+
'required' => [
|
1232
|
+
'type'
|
1233
|
+
],
|
1234
|
+
'allOf' => [
|
1235
|
+
{
|
1236
|
+
'$ref' => '#/$defs/specification-extensions'
|
1237
|
+
},
|
1238
|
+
{
|
1239
|
+
'$ref' => '#/$defs/security-scheme/$defs/type-apikey'
|
1240
|
+
},
|
1241
|
+
{
|
1242
|
+
'$ref' => '#/$defs/security-scheme/$defs/type-http'
|
1243
|
+
},
|
1244
|
+
{
|
1245
|
+
'$ref' => '#/$defs/security-scheme/$defs/type-http-bearer'
|
1246
|
+
},
|
1247
|
+
{
|
1248
|
+
'$ref' => '#/$defs/security-scheme/$defs/type-oauth2'
|
1249
|
+
},
|
1250
|
+
{
|
1251
|
+
'$ref' => '#/$defs/security-scheme/$defs/type-oidc'
|
1252
|
+
}
|
1253
|
+
],
|
1254
|
+
'unevaluatedProperties' => false,
|
1255
|
+
'$defs' => {
|
1256
|
+
'type-apikey' => {
|
1257
|
+
'if' => {
|
1258
|
+
'properties' => {
|
1259
|
+
'type' => {
|
1260
|
+
'const' => 'apiKey'
|
1261
|
+
}
|
1262
|
+
},
|
1263
|
+
'required' => [
|
1264
|
+
'type'
|
1265
|
+
]
|
1266
|
+
},
|
1267
|
+
'then' => {
|
1268
|
+
'properties' => {
|
1269
|
+
'name' => {
|
1270
|
+
'type' => 'string'
|
1271
|
+
},
|
1272
|
+
'in' => {
|
1273
|
+
'enum' => [
|
1274
|
+
'query',
|
1275
|
+
'header',
|
1276
|
+
'cookie'
|
1277
|
+
]
|
1278
|
+
}
|
1279
|
+
},
|
1280
|
+
'required' => [
|
1281
|
+
'name',
|
1282
|
+
'in'
|
1283
|
+
]
|
1284
|
+
}
|
1285
|
+
},
|
1286
|
+
'type-http' => {
|
1287
|
+
'if' => {
|
1288
|
+
'properties' => {
|
1289
|
+
'type' => {
|
1290
|
+
'const' => 'http'
|
1291
|
+
}
|
1292
|
+
},
|
1293
|
+
'required' => [
|
1294
|
+
'type'
|
1295
|
+
]
|
1296
|
+
},
|
1297
|
+
'then' => {
|
1298
|
+
'properties' => {
|
1299
|
+
'scheme' => {
|
1300
|
+
'type' => 'string'
|
1301
|
+
}
|
1302
|
+
},
|
1303
|
+
'required' => [
|
1304
|
+
'scheme'
|
1305
|
+
]
|
1306
|
+
}
|
1307
|
+
},
|
1308
|
+
'type-http-bearer' => {
|
1309
|
+
'if' => {
|
1310
|
+
'properties' => {
|
1311
|
+
'type' => {
|
1312
|
+
'const' => 'http'
|
1313
|
+
},
|
1314
|
+
'scheme' => {
|
1315
|
+
'type' => 'string',
|
1316
|
+
'pattern' => '^[Bb][Ee][Aa][Rr][Ee][Rr]$'
|
1317
|
+
}
|
1318
|
+
},
|
1319
|
+
'required' => [
|
1320
|
+
'type',
|
1321
|
+
'scheme'
|
1322
|
+
]
|
1323
|
+
},
|
1324
|
+
'then' => {
|
1325
|
+
'properties' => {
|
1326
|
+
'bearerFormat' => {
|
1327
|
+
'type' => 'string'
|
1328
|
+
}
|
1329
|
+
}
|
1330
|
+
}
|
1331
|
+
},
|
1332
|
+
'type-oauth2' => {
|
1333
|
+
'if' => {
|
1334
|
+
'properties' => {
|
1335
|
+
'type' => {
|
1336
|
+
'const' => 'oauth2'
|
1337
|
+
}
|
1338
|
+
},
|
1339
|
+
'required' => [
|
1340
|
+
'type'
|
1341
|
+
]
|
1342
|
+
},
|
1343
|
+
'then' => {
|
1344
|
+
'properties' => {
|
1345
|
+
'flows' => {
|
1346
|
+
'$ref' => '#/$defs/oauth-flows'
|
1347
|
+
}
|
1348
|
+
},
|
1349
|
+
'required' => [
|
1350
|
+
'flows'
|
1351
|
+
]
|
1352
|
+
}
|
1353
|
+
},
|
1354
|
+
'type-oidc' => {
|
1355
|
+
'if' => {
|
1356
|
+
'properties' => {
|
1357
|
+
'type' => {
|
1358
|
+
'const' => 'openIdConnect'
|
1359
|
+
}
|
1360
|
+
},
|
1361
|
+
'required' => [
|
1362
|
+
'type'
|
1363
|
+
]
|
1364
|
+
},
|
1365
|
+
'then' => {
|
1366
|
+
'properties' => {
|
1367
|
+
'openIdConnectUrl' => {
|
1368
|
+
'type' => 'string',
|
1369
|
+
'format' => 'uri'
|
1370
|
+
}
|
1371
|
+
},
|
1372
|
+
'required' => [
|
1373
|
+
'openIdConnectUrl'
|
1374
|
+
]
|
1375
|
+
}
|
1376
|
+
}
|
1377
|
+
}
|
1378
|
+
},
|
1379
|
+
'security-scheme-or-reference' => {
|
1380
|
+
'if' => {
|
1381
|
+
'type' => 'object',
|
1382
|
+
'required' => [
|
1383
|
+
'$ref'
|
1384
|
+
]
|
1385
|
+
},
|
1386
|
+
'then' => {
|
1387
|
+
'$ref' => '#/$defs/reference'
|
1388
|
+
},
|
1389
|
+
'else' => {
|
1390
|
+
'$ref' => '#/$defs/security-scheme'
|
1391
|
+
}
|
1392
|
+
},
|
1393
|
+
'oauth-flows' => {
|
1394
|
+
'type' => 'object',
|
1395
|
+
'properties' => {
|
1396
|
+
'implicit' => {
|
1397
|
+
'$ref' => '#/$defs/oauth-flows/$defs/implicit'
|
1398
|
+
},
|
1399
|
+
'password' => {
|
1400
|
+
'$ref' => '#/$defs/oauth-flows/$defs/password'
|
1401
|
+
},
|
1402
|
+
'clientCredentials' => {
|
1403
|
+
'$ref' => '#/$defs/oauth-flows/$defs/client-credentials'
|
1404
|
+
},
|
1405
|
+
'authorizationCode' => {
|
1406
|
+
'$ref' => '#/$defs/oauth-flows/$defs/authorization-code'
|
1407
|
+
}
|
1408
|
+
},
|
1409
|
+
'$ref' => '#/$defs/specification-extensions',
|
1410
|
+
'unevaluatedProperties' => false,
|
1411
|
+
'$defs' => {
|
1412
|
+
'implicit' => {
|
1413
|
+
'type' => 'object',
|
1414
|
+
'properties' => {
|
1415
|
+
'authorizationUrl' => {
|
1416
|
+
'type' => 'string',
|
1417
|
+
'format' => 'uri'
|
1418
|
+
},
|
1419
|
+
'refreshUrl' => {
|
1420
|
+
'type' => 'string',
|
1421
|
+
'format' => 'uri'
|
1422
|
+
},
|
1423
|
+
'scopes' => {
|
1424
|
+
'$ref' => '#/$defs/map-of-strings'
|
1425
|
+
}
|
1426
|
+
},
|
1427
|
+
'required' => [
|
1428
|
+
'authorizationUrl',
|
1429
|
+
'scopes'
|
1430
|
+
],
|
1431
|
+
'$ref' => '#/$defs/specification-extensions',
|
1432
|
+
'unevaluatedProperties' => false
|
1433
|
+
},
|
1434
|
+
'password' => {
|
1435
|
+
'type' => 'object',
|
1436
|
+
'properties' => {
|
1437
|
+
'tokenUrl' => {
|
1438
|
+
'type' => 'string',
|
1439
|
+
'format' => 'uri'
|
1440
|
+
},
|
1441
|
+
'refreshUrl' => {
|
1442
|
+
'type' => 'string',
|
1443
|
+
'format' => 'uri'
|
1444
|
+
},
|
1445
|
+
'scopes' => {
|
1446
|
+
'$ref' => '#/$defs/map-of-strings'
|
1447
|
+
}
|
1448
|
+
},
|
1449
|
+
'required' => [
|
1450
|
+
'tokenUrl',
|
1451
|
+
'scopes'
|
1452
|
+
],
|
1453
|
+
'$ref' => '#/$defs/specification-extensions',
|
1454
|
+
'unevaluatedProperties' => false
|
1455
|
+
},
|
1456
|
+
'client-credentials' => {
|
1457
|
+
'type' => 'object',
|
1458
|
+
'properties' => {
|
1459
|
+
'tokenUrl' => {
|
1460
|
+
'type' => 'string',
|
1461
|
+
'format' => 'uri'
|
1462
|
+
},
|
1463
|
+
'refreshUrl' => {
|
1464
|
+
'type' => 'string',
|
1465
|
+
'format' => 'uri'
|
1466
|
+
},
|
1467
|
+
'scopes' => {
|
1468
|
+
'$ref' => '#/$defs/map-of-strings'
|
1469
|
+
}
|
1470
|
+
},
|
1471
|
+
'required' => [
|
1472
|
+
'tokenUrl',
|
1473
|
+
'scopes'
|
1474
|
+
],
|
1475
|
+
'$ref' => '#/$defs/specification-extensions',
|
1476
|
+
'unevaluatedProperties' => false
|
1477
|
+
},
|
1478
|
+
'authorization-code' => {
|
1479
|
+
'type' => 'object',
|
1480
|
+
'properties' => {
|
1481
|
+
'authorizationUrl' => {
|
1482
|
+
'type' => 'string',
|
1483
|
+
'format' => 'uri'
|
1484
|
+
},
|
1485
|
+
'tokenUrl' => {
|
1486
|
+
'type' => 'string',
|
1487
|
+
'format' => 'uri'
|
1488
|
+
},
|
1489
|
+
'refreshUrl' => {
|
1490
|
+
'type' => 'string',
|
1491
|
+
'format' => 'uri'
|
1492
|
+
},
|
1493
|
+
'scopes' => {
|
1494
|
+
'$ref' => '#/$defs/map-of-strings'
|
1495
|
+
}
|
1496
|
+
},
|
1497
|
+
'required' => [
|
1498
|
+
'authorizationUrl',
|
1499
|
+
'tokenUrl',
|
1500
|
+
'scopes'
|
1501
|
+
],
|
1502
|
+
'$ref' => '#/$defs/specification-extensions',
|
1503
|
+
'unevaluatedProperties' => false
|
1504
|
+
}
|
1505
|
+
}
|
1506
|
+
},
|
1507
|
+
'security-requirement' => {
|
1508
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#security-requirement-object',
|
1509
|
+
'type' => 'object',
|
1510
|
+
'additionalProperties' => {
|
1511
|
+
'type' => 'array',
|
1512
|
+
'items' => {
|
1513
|
+
'type' => 'string'
|
1514
|
+
}
|
1515
|
+
}
|
1516
|
+
},
|
1517
|
+
'specification-extensions' => {
|
1518
|
+
'$comment' => 'https://spec.openapis.org/oas/v3.1.0#specification-extensions',
|
1519
|
+
'patternProperties' => {
|
1520
|
+
'^x-' => true
|
1521
|
+
}
|
1522
|
+
},
|
1523
|
+
'examples' => {
|
1524
|
+
'properties' => {
|
1525
|
+
'example' => true,
|
1526
|
+
'examples' => {
|
1527
|
+
'type' => 'object',
|
1528
|
+
'additionalProperties' => {
|
1529
|
+
'$ref' => '#/$defs/example-or-reference'
|
1530
|
+
}
|
1531
|
+
}
|
1532
|
+
}
|
1533
|
+
},
|
1534
|
+
'map-of-strings' => {
|
1535
|
+
'type' => 'object',
|
1536
|
+
'additionalProperties' => {
|
1537
|
+
'type' => 'string'
|
1538
|
+
}
|
1539
|
+
}
|
1540
|
+
}
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
SCHEMAS = OpenAPI31::Meta::SCHEMAS
|
1544
|
+
.merge(Draft202012::Meta::SCHEMAS)
|
1545
|
+
.merge(Draft201909::Meta::SCHEMAS)
|
1546
|
+
.merge(
|
1547
|
+
URI('https://spec.openapis.org/oas/3.1/schema/2022-10-07') => SCHEMA,
|
1548
|
+
OpenAPI31::BASE_URI => OpenAPI31::SCHEMA,
|
1549
|
+
Draft202012::BASE_URI => Draft202012::SCHEMA,
|
1550
|
+
Draft201909::BASE_URI => Draft201909::SCHEMA,
|
1551
|
+
Draft7::BASE_URI.dup.tap { |uri| uri.fragment = nil } => Draft7::SCHEMA,
|
1552
|
+
Draft6::BASE_URI.dup.tap { |uri| uri.fragment = nil } => Draft6::SCHEMA,
|
1553
|
+
Draft4::BASE_URI.dup.tap { |uri| uri.fragment = nil } => Draft4::SCHEMA
|
1554
|
+
)
|
1555
|
+
end
|
1556
|
+
end
|
1557
|
+
end
|