json_schemer 1.0.3 → 2.1.0

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