@openlint/ruleset-spectral-oas 0.0.0-stage → 0.1.0

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.
Files changed (98) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +11 -2
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.js +8 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/oas/functions/index.d.ts +15 -0
  7. package/dist/oas/functions/index.js +33 -0
  8. package/dist/oas/functions/index.js.map +1 -0
  9. package/dist/oas/functions/oasDiscriminator.d.ts +6 -0
  10. package/dist/oas/functions/oasDiscriminator.js +39 -0
  11. package/dist/oas/functions/oasDiscriminator.js.map +1 -0
  12. package/dist/oas/functions/oasDocumentSchema.d.ts +2 -0
  13. package/dist/oas/functions/oasDocumentSchema.js +104 -0
  14. package/dist/oas/functions/oasDocumentSchema.js.map +1 -0
  15. package/dist/oas/functions/oasExample.d.ts +7 -0
  16. package/dist/oas/functions/oasExample.js +217 -0
  17. package/dist/oas/functions/oasExample.js.map +1 -0
  18. package/dist/oas/functions/oasOpFormDataConsumeCheck.d.ts +6 -0
  19. package/dist/oas/functions/oasOpFormDataConsumeCheck.js +30 -0
  20. package/dist/oas/functions/oasOpFormDataConsumeCheck.js.map +1 -0
  21. package/dist/oas/functions/oasOpIdUnique.d.ts +2 -0
  22. package/dist/oas/functions/oasOpIdUnique.js +35 -0
  23. package/dist/oas/functions/oasOpIdUnique.js.map +1 -0
  24. package/dist/oas/functions/oasOpParams.d.ts +2 -0
  25. package/dist/oas/functions/oasOpParams.js +75 -0
  26. package/dist/oas/functions/oasOpParams.js.map +1 -0
  27. package/dist/oas/functions/oasOpSuccessResponse.d.ts +2 -0
  28. package/dist/oas/functions/oasOpSuccessResponse.js +27 -0
  29. package/dist/oas/functions/oasOpSuccessResponse.js.map +1 -0
  30. package/dist/oas/functions/oasPathParam.d.ts +2 -0
  31. package/dist/oas/functions/oasPathParam.js +135 -0
  32. package/dist/oas/functions/oasPathParam.js.map +1 -0
  33. package/dist/oas/functions/oasSchema.d.ts +5 -0
  34. package/dist/oas/functions/oasSchema.js +81 -0
  35. package/dist/oas/functions/oasSchema.js.map +1 -0
  36. package/dist/oas/functions/oasSecurityDefined.d.ts +5 -0
  37. package/dist/oas/functions/oasSecurityDefined.js +76 -0
  38. package/dist/oas/functions/oasSecurityDefined.js.map +1 -0
  39. package/dist/oas/functions/oasTagDefined.d.ts +2 -0
  40. package/dist/oas/functions/oasTagDefined.js +42 -0
  41. package/dist/oas/functions/oasTagDefined.js.map +1 -0
  42. package/dist/oas/functions/oasUnusedComponent.d.ts +4 -0
  43. package/dist/oas/functions/oasUnusedComponent.js +40 -0
  44. package/dist/oas/functions/oasUnusedComponent.js.map +1 -0
  45. package/dist/oas/functions/refSiblings.d.ts +2 -0
  46. package/dist/oas/functions/refSiblings.js +42 -0
  47. package/dist/oas/functions/refSiblings.js.map +1 -0
  48. package/dist/oas/functions/typedEnum.d.ts +7 -0
  49. package/dist/oas/functions/typedEnum.js +76 -0
  50. package/dist/oas/functions/typedEnum.js.map +1 -0
  51. package/dist/oas/functions/utils/getAllOperations.d.ts +7 -0
  52. package/dist/oas/functions/utils/getAllOperations.js +31 -0
  53. package/dist/oas/functions/utils/getAllOperations.js.map +1 -0
  54. package/dist/oas/functions/utils/isObject.d.ts +2 -0
  55. package/dist/oas/functions/utils/isObject.js +7 -0
  56. package/dist/oas/functions/utils/isObject.js.map +1 -0
  57. package/dist/oas/index.d.ts +733 -0
  58. package/dist/oas/index.js +765 -0
  59. package/dist/oas/index.js.map +1 -0
  60. package/dist/oas/schemas/__fixtures__/validate.d.ts +1 -0
  61. package/dist/oas/schemas/__fixtures__/validate.js +3 -0
  62. package/dist/oas/schemas/__fixtures__/validate.js.map +1 -0
  63. package/dist/oas/schemas/json-schema/draft-04.json +137 -0
  64. package/dist/oas/schemas/json-schema/draft-2020-12/index.json +54 -0
  65. package/dist/oas/schemas/json-schema/draft-2020-12/validation.json +101 -0
  66. package/dist/oas/schemas/oas/v2.0.json +1478 -0
  67. package/dist/oas/schemas/oas/v3.0.json +1652 -0
  68. package/dist/oas/schemas/oas/v3.1/dialect.schema.json +35 -0
  69. package/dist/oas/schemas/oas/v3.1/index.json +1276 -0
  70. package/dist/oas/schemas/oas/v3.1/meta.schema.json +93 -0
  71. package/dist/oas/schemas/oas/v3.2/dialect.schema.json +25 -0
  72. package/dist/oas/schemas/oas/v3.2/index.json +1527 -0
  73. package/dist/oas/schemas/oas/v3.2/meta.schema.json +103 -0
  74. package/dist/oas/schemas/validators.d.ts +66 -0
  75. package/dist/oas/schemas/validators.js +12991 -0
  76. package/dist/oas/schemas/validators.js.map +1 -0
  77. package/dist/shared/functions/index.d.ts +2 -0
  78. package/dist/shared/functions/index.js +7 -0
  79. package/dist/shared/functions/index.js.map +1 -0
  80. package/dist/shared/functions/serverVariables/index.d.ts +16 -0
  81. package/dist/shared/functions/serverVariables/index.js +154 -0
  82. package/dist/shared/functions/serverVariables/index.js.map +1 -0
  83. package/dist/shared/functions/serverVariables/utils/applyUrlVariables.d.ts +3 -0
  84. package/dist/shared/functions/serverVariables/utils/applyUrlVariables.js +32 -0
  85. package/dist/shared/functions/serverVariables/utils/applyUrlVariables.js.map +1 -0
  86. package/dist/shared/functions/serverVariables/utils/parseUrlVariables.d.ts +1 -0
  87. package/dist/shared/functions/serverVariables/utils/parseUrlVariables.js +12 -0
  88. package/dist/shared/functions/serverVariables/utils/parseUrlVariables.js.map +1 -0
  89. package/dist/shared/functions/uniquenessTags.d.ts +5 -0
  90. package/dist/shared/functions/uniquenessTags.js +42 -0
  91. package/dist/shared/functions/uniquenessTags.js.map +1 -0
  92. package/dist/shared/utils/getMissingProps.d.ts +1 -0
  93. package/dist/shared/utils/getMissingProps.js +9 -0
  94. package/dist/shared/utils/getMissingProps.js.map +1 -0
  95. package/dist/shared/utils/getRedundantProps.d.ts +1 -0
  96. package/dist/shared/utils/getRedundantProps.js +9 -0
  97. package/dist/shared/utils/getRedundantProps.js.map +1 -0
  98. package/package.json +47 -4
@@ -0,0 +1,1276 @@
1
+ {
2
+ "$id": "https://spec.openapis.org/oas/3.1/schema/2021-09-28",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "description": "The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0",
5
+ "type": "object",
6
+ "properties": {
7
+ "openapi": {
8
+ "type": "string",
9
+ "pattern": "^3\\.1\\.\\d+(-.+)?$"
10
+ },
11
+ "info": {
12
+ "$ref": "#/$defs/info"
13
+ },
14
+ "jsonSchemaDialect": {
15
+ "type": "string",
16
+ "format": "uri",
17
+ "default": "https://spec.openapis.org/oas/3.1/dialect/base"
18
+ },
19
+ "servers": {
20
+ "type": "array",
21
+ "items": {
22
+ "$ref": "#/$defs/server"
23
+ },
24
+ "default": [
25
+ {
26
+ "url": "/"
27
+ }
28
+ ]
29
+ },
30
+ "paths": {
31
+ "$ref": "#/$defs/paths"
32
+ },
33
+ "webhooks": {
34
+ "type": "object",
35
+ "additionalProperties": {
36
+ "$ref": "#/$defs/path-item-or-reference"
37
+ }
38
+ },
39
+ "components": {
40
+ "$ref": "#/$defs/components"
41
+ },
42
+ "security": {
43
+ "type": "array",
44
+ "items": {
45
+ "$ref": "#/$defs/security-requirement"
46
+ }
47
+ },
48
+ "tags": {
49
+ "type": "array",
50
+ "items": {
51
+ "$ref": "#/$defs/tag"
52
+ }
53
+ },
54
+ "externalDocs": {
55
+ "$ref": "#/$defs/external-documentation"
56
+ }
57
+ },
58
+ "required": ["openapi", "info"],
59
+ "errorMessage": {
60
+ "anyOf": "The document must have either \"paths\", \"webhooks\" or \"components\""
61
+ },
62
+ "anyOf": [
63
+ {
64
+ "errorMessage": "The document must have either \"paths\", \"webhooks\" or \"components\"",
65
+ "required": ["paths"]
66
+ },
67
+ {
68
+ "errorMessage": "The document must have either \"paths\", \"webhooks\" or \"components\"",
69
+ "required": ["components"]
70
+ },
71
+ {
72
+ "errorMessage": "The document must have either \"paths\", \"webhooks\" or \"components\"",
73
+ "required": ["webhooks"]
74
+ }
75
+ ],
76
+ "$ref": "#/$defs/specification-extensions",
77
+ "unevaluatedProperties": false,
78
+ "$defs": {
79
+ "info": {
80
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#info-object",
81
+ "type": "object",
82
+ "properties": {
83
+ "title": {
84
+ "type": "string"
85
+ },
86
+ "summary": {
87
+ "type": "string"
88
+ },
89
+ "description": {
90
+ "type": "string"
91
+ },
92
+ "termsOfService": {
93
+ "type": "string",
94
+ "format": "uri"
95
+ },
96
+ "contact": {
97
+ "$ref": "#/$defs/contact"
98
+ },
99
+ "license": {
100
+ "$ref": "#/$defs/license"
101
+ },
102
+ "version": {
103
+ "type": "string"
104
+ }
105
+ },
106
+ "required": ["title", "version"],
107
+ "$ref": "#/$defs/specification-extensions",
108
+ "unevaluatedProperties": false
109
+ },
110
+ "contact": {
111
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#contact-object",
112
+ "type": "object",
113
+ "properties": {
114
+ "name": {
115
+ "type": "string"
116
+ },
117
+ "url": {
118
+ "type": "string",
119
+ "format": "uri"
120
+ },
121
+ "email": {
122
+ "type": "string",
123
+ "format": "email"
124
+ }
125
+ },
126
+ "$ref": "#/$defs/specification-extensions",
127
+ "unevaluatedProperties": false
128
+ },
129
+ "license": {
130
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#license-object",
131
+ "type": "object",
132
+ "properties": {
133
+ "name": {
134
+ "type": "string"
135
+ },
136
+ "identifier": {
137
+ "type": "string"
138
+ },
139
+ "url": {
140
+ "type": "string",
141
+ "format": "uri"
142
+ }
143
+ },
144
+ "required": ["name"],
145
+ "dependentSchemas": {
146
+ "identifier": {
147
+ "not": {
148
+ "required": ["url"]
149
+ }
150
+ }
151
+ },
152
+ "$ref": "#/$defs/specification-extensions",
153
+ "unevaluatedProperties": false
154
+ },
155
+ "server": {
156
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#server-object",
157
+ "type": "object",
158
+ "properties": {
159
+ "url": {
160
+ "type": "string"
161
+ },
162
+ "description": {
163
+ "type": "string"
164
+ },
165
+ "variables": {
166
+ "type": "object",
167
+ "additionalProperties": {
168
+ "$ref": "#/$defs/server-variable"
169
+ }
170
+ }
171
+ },
172
+ "required": ["url"],
173
+ "$ref": "#/$defs/specification-extensions",
174
+ "unevaluatedProperties": false
175
+ },
176
+ "server-variable": {
177
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#server-variable-object",
178
+ "type": "object",
179
+ "properties": {
180
+ "enum": {
181
+ "type": "array",
182
+ "items": {
183
+ "type": "string"
184
+ },
185
+ "minItems": 1
186
+ },
187
+ "default": {
188
+ "type": "string"
189
+ },
190
+ "description": {
191
+ "type": "string"
192
+ }
193
+ },
194
+ "required": ["default"],
195
+ "$ref": "#/$defs/specification-extensions",
196
+ "unevaluatedProperties": false
197
+ },
198
+ "components": {
199
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#components-object",
200
+ "type": "object",
201
+ "properties": {
202
+ "schemas": {
203
+ "type": "object",
204
+ "additionalProperties": {
205
+ "$ref": "https://spec.openapis.org/oas/3.1/dialect/base"
206
+ }
207
+ },
208
+ "responses": {
209
+ "type": "object",
210
+ "additionalProperties": {
211
+ "$ref": "#/$defs/response-or-reference"
212
+ }
213
+ },
214
+ "parameters": {
215
+ "type": "object",
216
+ "additionalProperties": {
217
+ "$ref": "#/$defs/parameter-or-reference"
218
+ }
219
+ },
220
+ "examples": {
221
+ "type": "object",
222
+ "additionalProperties": {
223
+ "$ref": "#/$defs/example-or-reference"
224
+ }
225
+ },
226
+ "requestBodies": {
227
+ "type": "object",
228
+ "additionalProperties": {
229
+ "$ref": "#/$defs/request-body-or-reference"
230
+ }
231
+ },
232
+ "headers": {
233
+ "type": "object",
234
+ "additionalProperties": {
235
+ "$ref": "#/$defs/header-or-reference"
236
+ }
237
+ },
238
+ "securitySchemes": {
239
+ "type": "object",
240
+ "additionalProperties": {
241
+ "$ref": "#/$defs/security-scheme-or-reference"
242
+ }
243
+ },
244
+ "links": {
245
+ "type": "object",
246
+ "additionalProperties": {
247
+ "$ref": "#/$defs/link-or-reference"
248
+ }
249
+ },
250
+ "callbacks": {
251
+ "type": "object",
252
+ "additionalProperties": {
253
+ "$ref": "#/$defs/callbacks-or-reference"
254
+ }
255
+ },
256
+ "pathItems": {
257
+ "type": "object",
258
+ "additionalProperties": {
259
+ "$ref": "#/$defs/path-item-or-reference"
260
+ }
261
+ }
262
+ },
263
+ "patternProperties": {
264
+ "^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$": {
265
+ "$comment": "Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected",
266
+ "propertyNames": {
267
+ "pattern": "^[a-zA-Z0-9._-]+$"
268
+ }
269
+ }
270
+ },
271
+ "$ref": "#/$defs/specification-extensions",
272
+ "unevaluatedProperties": false
273
+ },
274
+ "paths": {
275
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#paths-object",
276
+ "type": "object",
277
+ "patternProperties": {
278
+ "^/": {
279
+ "$ref": "#/$defs/path-item"
280
+ }
281
+ },
282
+ "$ref": "#/$defs/specification-extensions",
283
+ "unevaluatedProperties": false
284
+ },
285
+ "path-item": {
286
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#path-item-object",
287
+ "type": "object",
288
+ "properties": {
289
+ "summary": {
290
+ "type": "string"
291
+ },
292
+ "description": {
293
+ "type": "string"
294
+ },
295
+ "servers": {
296
+ "type": "array",
297
+ "items": {
298
+ "$ref": "#/$defs/server"
299
+ }
300
+ },
301
+ "parameters": {
302
+ "type": "array",
303
+ "items": {
304
+ "$ref": "#/$defs/parameter-or-reference"
305
+ }
306
+ },
307
+ "get": {
308
+ "$ref": "#/$defs/operation"
309
+ },
310
+ "put": {
311
+ "$ref": "#/$defs/operation"
312
+ },
313
+ "post": {
314
+ "$ref": "#/$defs/operation"
315
+ },
316
+ "delete": {
317
+ "$ref": "#/$defs/operation"
318
+ },
319
+ "options": {
320
+ "$ref": "#/$defs/operation"
321
+ },
322
+ "head": {
323
+ "$ref": "#/$defs/operation"
324
+ },
325
+ "patch": {
326
+ "$ref": "#/$defs/operation"
327
+ },
328
+ "trace": {
329
+ "$ref": "#/$defs/operation"
330
+ }
331
+ },
332
+ "$ref": "#/$defs/specification-extensions",
333
+ "unevaluatedProperties": false
334
+ },
335
+ "path-item-or-reference": {
336
+ "if": {
337
+ "type": "object",
338
+ "required": ["$ref"]
339
+ },
340
+ "then": {
341
+ "$ref": "#/$defs/reference"
342
+ },
343
+ "else": {
344
+ "$ref": "#/$defs/path-item"
345
+ }
346
+ },
347
+ "operation": {
348
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#operation-object",
349
+ "type": "object",
350
+ "properties": {
351
+ "tags": {
352
+ "type": "array",
353
+ "items": {
354
+ "type": "string"
355
+ }
356
+ },
357
+ "summary": {
358
+ "type": "string"
359
+ },
360
+ "description": {
361
+ "type": "string"
362
+ },
363
+ "externalDocs": {
364
+ "$ref": "#/$defs/external-documentation"
365
+ },
366
+ "operationId": {
367
+ "type": "string"
368
+ },
369
+ "parameters": {
370
+ "type": "array",
371
+ "items": {
372
+ "$ref": "#/$defs/parameter-or-reference"
373
+ }
374
+ },
375
+ "requestBody": {
376
+ "$ref": "#/$defs/request-body-or-reference"
377
+ },
378
+ "responses": {
379
+ "$ref": "#/$defs/responses"
380
+ },
381
+ "callbacks": {
382
+ "type": "object",
383
+ "additionalProperties": {
384
+ "$ref": "#/$defs/callbacks-or-reference"
385
+ }
386
+ },
387
+ "deprecated": {
388
+ "default": false,
389
+ "type": "boolean"
390
+ },
391
+ "security": {
392
+ "type": "array",
393
+ "items": {
394
+ "$ref": "#/$defs/security-requirement"
395
+ }
396
+ },
397
+ "servers": {
398
+ "type": "array",
399
+ "items": {
400
+ "$ref": "#/$defs/server"
401
+ }
402
+ }
403
+ },
404
+ "$ref": "#/$defs/specification-extensions",
405
+ "unevaluatedProperties": false
406
+ },
407
+ "external-documentation": {
408
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#external-documentation-object",
409
+ "type": "object",
410
+ "properties": {
411
+ "description": {
412
+ "type": "string"
413
+ },
414
+ "url": {
415
+ "type": "string",
416
+ "format": "uri"
417
+ }
418
+ },
419
+ "required": ["url"],
420
+ "$ref": "#/$defs/specification-extensions",
421
+ "unevaluatedProperties": false
422
+ },
423
+ "parameter": {
424
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#parameter-object",
425
+ "type": "object",
426
+ "properties": {
427
+ "name": {
428
+ "type": "string"
429
+ },
430
+ "in": {
431
+ "enum": ["query", "header", "path", "cookie"]
432
+ },
433
+ "description": {
434
+ "type": "string"
435
+ },
436
+ "required": {
437
+ "default": false,
438
+ "type": "boolean"
439
+ },
440
+ "deprecated": {
441
+ "default": false,
442
+ "type": "boolean"
443
+ },
444
+ "schema": {
445
+ "$ref": "https://spec.openapis.org/oas/3.1/dialect/base"
446
+ },
447
+ "content": {
448
+ "$ref": "#/$defs/content",
449
+ "minProperties": 1,
450
+ "maxProperties": 1
451
+ }
452
+ },
453
+ "required": ["name", "in"],
454
+ "oneOf": [
455
+ {
456
+ "required": ["schema"]
457
+ },
458
+ {
459
+ "required": ["content"]
460
+ }
461
+ ],
462
+ "if": {
463
+ "properties": {
464
+ "in": {
465
+ "const": "query"
466
+ }
467
+ },
468
+ "required": ["in"]
469
+ },
470
+ "then": {
471
+ "properties": {
472
+ "allowEmptyValue": {
473
+ "default": false,
474
+ "type": "boolean"
475
+ }
476
+ }
477
+ },
478
+ "dependentSchemas": {
479
+ "schema": {
480
+ "properties": {
481
+ "style": {
482
+ "type": "string"
483
+ },
484
+ "explode": {
485
+ "type": "boolean"
486
+ }
487
+ },
488
+ "allOf": [
489
+ {
490
+ "$ref": "#/$defs/examples"
491
+ },
492
+ {
493
+ "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path"
494
+ },
495
+ {
496
+ "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header"
497
+ },
498
+ {
499
+ "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query"
500
+ },
501
+ {
502
+ "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie"
503
+ },
504
+ {
505
+ "$ref": "#/$defs/styles-for-form"
506
+ }
507
+ ],
508
+ "$defs": {
509
+ "styles-for-path": {
510
+ "if": {
511
+ "properties": {
512
+ "in": {
513
+ "const": "path"
514
+ }
515
+ },
516
+ "required": ["in"]
517
+ },
518
+ "then": {
519
+ "properties": {
520
+ "style": {
521
+ "default": "simple",
522
+ "enum": ["matrix", "label", "simple"]
523
+ },
524
+ "required": {
525
+ "const": true
526
+ }
527
+ },
528
+ "required": ["required"]
529
+ }
530
+ },
531
+ "styles-for-header": {
532
+ "if": {
533
+ "properties": {
534
+ "in": {
535
+ "const": "header"
536
+ }
537
+ },
538
+ "required": ["in"]
539
+ },
540
+ "then": {
541
+ "properties": {
542
+ "style": {
543
+ "default": "simple",
544
+ "const": "simple"
545
+ }
546
+ }
547
+ }
548
+ },
549
+ "styles-for-query": {
550
+ "if": {
551
+ "properties": {
552
+ "in": {
553
+ "const": "query"
554
+ }
555
+ },
556
+ "required": ["in"]
557
+ },
558
+ "then": {
559
+ "properties": {
560
+ "style": {
561
+ "default": "form",
562
+ "enum": ["form", "spaceDelimited", "pipeDelimited", "deepObject"]
563
+ },
564
+ "allowReserved": {
565
+ "default": false,
566
+ "type": "boolean"
567
+ }
568
+ }
569
+ }
570
+ },
571
+ "styles-for-cookie": {
572
+ "if": {
573
+ "properties": {
574
+ "in": {
575
+ "const": "cookie"
576
+ }
577
+ },
578
+ "required": ["in"]
579
+ },
580
+ "then": {
581
+ "properties": {
582
+ "style": {
583
+ "default": "form",
584
+ "const": "form"
585
+ }
586
+ }
587
+ }
588
+ }
589
+ }
590
+ }
591
+ },
592
+ "$ref": "#/$defs/specification-extensions",
593
+ "unevaluatedProperties": false
594
+ },
595
+ "parameter-or-reference": {
596
+ "if": {
597
+ "type": "object",
598
+ "required": ["$ref"]
599
+ },
600
+ "then": {
601
+ "$ref": "#/$defs/reference"
602
+ },
603
+ "else": {
604
+ "$ref": "#/$defs/parameter"
605
+ }
606
+ },
607
+ "request-body": {
608
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#request-body-object",
609
+ "type": "object",
610
+ "properties": {
611
+ "description": {
612
+ "type": "string"
613
+ },
614
+ "content": {
615
+ "$ref": "#/$defs/content"
616
+ },
617
+ "required": {
618
+ "default": false,
619
+ "type": "boolean"
620
+ }
621
+ },
622
+ "required": ["content"],
623
+ "$ref": "#/$defs/specification-extensions",
624
+ "unevaluatedProperties": false
625
+ },
626
+ "request-body-or-reference": {
627
+ "if": {
628
+ "type": "object",
629
+ "required": ["$ref"]
630
+ },
631
+ "then": {
632
+ "$ref": "#/$defs/reference"
633
+ },
634
+ "else": {
635
+ "$ref": "#/$defs/request-body"
636
+ }
637
+ },
638
+ "content": {
639
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#fixed-fields-10",
640
+ "type": "object",
641
+ "additionalProperties": {
642
+ "$ref": "#/$defs/media-type"
643
+ },
644
+ "propertyNames": {
645
+ "format": "media-range"
646
+ }
647
+ },
648
+ "media-type": {
649
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#media-type-object",
650
+ "type": "object",
651
+ "properties": {
652
+ "schema": {
653
+ "$ref": "https://spec.openapis.org/oas/3.1/dialect/base"
654
+ },
655
+ "encoding": {
656
+ "type": "object",
657
+ "additionalProperties": {
658
+ "$ref": "#/$defs/encoding"
659
+ }
660
+ }
661
+ },
662
+ "allOf": [
663
+ {
664
+ "$ref": "#/$defs/specification-extensions"
665
+ },
666
+ {
667
+ "$ref": "#/$defs/examples"
668
+ }
669
+ ],
670
+ "unevaluatedProperties": false
671
+ },
672
+ "encoding": {
673
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#encoding-object",
674
+ "type": "object",
675
+ "properties": {
676
+ "contentType": {
677
+ "type": "string",
678
+ "format": "media-range"
679
+ },
680
+ "headers": {
681
+ "type": "object",
682
+ "additionalProperties": {
683
+ "$ref": "#/$defs/header-or-reference"
684
+ }
685
+ },
686
+ "style": {
687
+ "default": "form",
688
+ "enum": ["form", "spaceDelimited", "pipeDelimited", "deepObject"]
689
+ },
690
+ "explode": {
691
+ "type": "boolean"
692
+ },
693
+ "allowReserved": {
694
+ "default": false,
695
+ "type": "boolean"
696
+ }
697
+ },
698
+ "allOf": [
699
+ {
700
+ "$ref": "#/$defs/specification-extensions"
701
+ },
702
+ {
703
+ "$ref": "#/$defs/styles-for-form"
704
+ }
705
+ ],
706
+ "unevaluatedProperties": false
707
+ },
708
+ "responses": {
709
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#responses-object",
710
+ "type": "object",
711
+ "properties": {
712
+ "default": {
713
+ "$ref": "#/$defs/response-or-reference"
714
+ }
715
+ },
716
+ "patternProperties": {
717
+ "^[1-5](?:[0-9]{2}|XX)$": {
718
+ "$ref": "#/$defs/response-or-reference"
719
+ }
720
+ },
721
+ "minProperties": 1,
722
+ "$ref": "#/$defs/specification-extensions",
723
+ "unevaluatedProperties": false,
724
+ "if": {
725
+ "$comment": "either default, or at least one response code property must exist",
726
+ "patternProperties": {
727
+ "^[1-5](?:[0-9]{2}|XX)$": false
728
+ }
729
+ },
730
+ "then": {
731
+ "required": ["default"]
732
+ }
733
+ },
734
+ "response": {
735
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#response-object",
736
+ "type": "object",
737
+ "properties": {
738
+ "description": {
739
+ "type": "string"
740
+ },
741
+ "headers": {
742
+ "type": "object",
743
+ "additionalProperties": {
744
+ "$ref": "#/$defs/header-or-reference"
745
+ }
746
+ },
747
+ "content": {
748
+ "$ref": "#/$defs/content"
749
+ },
750
+ "links": {
751
+ "type": "object",
752
+ "additionalProperties": {
753
+ "$ref": "#/$defs/link-or-reference"
754
+ }
755
+ }
756
+ },
757
+ "required": ["description"],
758
+ "$ref": "#/$defs/specification-extensions",
759
+ "unevaluatedProperties": false
760
+ },
761
+ "response-or-reference": {
762
+ "if": {
763
+ "type": "object",
764
+ "required": ["$ref"]
765
+ },
766
+ "then": {
767
+ "$ref": "#/$defs/reference"
768
+ },
769
+ "else": {
770
+ "$ref": "#/$defs/response"
771
+ }
772
+ },
773
+ "callbacks": {
774
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#callback-object",
775
+ "type": "object",
776
+ "$ref": "#/$defs/specification-extensions",
777
+ "additionalProperties": {
778
+ "$ref": "#/$defs/path-item-or-reference"
779
+ }
780
+ },
781
+ "callbacks-or-reference": {
782
+ "if": {
783
+ "type": "object",
784
+ "required": ["$ref"]
785
+ },
786
+ "then": {
787
+ "$ref": "#/$defs/reference"
788
+ },
789
+ "else": {
790
+ "$ref": "#/$defs/callbacks"
791
+ }
792
+ },
793
+ "example": {
794
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#example-object",
795
+ "type": "object",
796
+ "properties": {
797
+ "summary": {
798
+ "type": "string"
799
+ },
800
+ "description": {
801
+ "type": "string"
802
+ },
803
+ "value": true,
804
+ "externalValue": {
805
+ "type": "string",
806
+ "format": "uri-reference"
807
+ }
808
+ },
809
+ "not": {
810
+ "required": ["value", "externalValue"]
811
+ },
812
+ "$ref": "#/$defs/specification-extensions",
813
+ "unevaluatedProperties": false
814
+ },
815
+ "example-or-reference": {
816
+ "if": {
817
+ "type": "object",
818
+ "required": ["$ref"]
819
+ },
820
+ "then": {
821
+ "$ref": "#/$defs/reference"
822
+ },
823
+ "else": {
824
+ "$ref": "#/$defs/example"
825
+ }
826
+ },
827
+ "link": {
828
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#link-object",
829
+ "type": "object",
830
+ "properties": {
831
+ "operationRef": {
832
+ "type": "string",
833
+ "format": "uri-reference"
834
+ },
835
+ "operationId": {
836
+ "type": "string"
837
+ },
838
+ "parameters": {
839
+ "$ref": "#/$defs/map-of-strings"
840
+ },
841
+ "requestBody": true,
842
+ "description": {
843
+ "type": "string"
844
+ },
845
+ "body": {
846
+ "$ref": "#/$defs/server"
847
+ }
848
+ },
849
+ "oneOf": [
850
+ {
851
+ "required": ["operationRef"]
852
+ },
853
+ {
854
+ "required": ["operationId"]
855
+ }
856
+ ],
857
+ "$ref": "#/$defs/specification-extensions",
858
+ "unevaluatedProperties": false
859
+ },
860
+ "link-or-reference": {
861
+ "if": {
862
+ "type": "object",
863
+ "required": ["$ref"]
864
+ },
865
+ "then": {
866
+ "$ref": "#/$defs/reference"
867
+ },
868
+ "else": {
869
+ "$ref": "#/$defs/link"
870
+ }
871
+ },
872
+ "header": {
873
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#header-object",
874
+ "type": "object",
875
+ "properties": {
876
+ "description": {
877
+ "type": "string"
878
+ },
879
+ "required": {
880
+ "default": false,
881
+ "type": "boolean"
882
+ },
883
+ "deprecated": {
884
+ "default": false,
885
+ "type": "boolean"
886
+ },
887
+ "schema": {
888
+ "$ref": "https://spec.openapis.org/oas/3.1/dialect/base"
889
+ },
890
+ "content": {
891
+ "$ref": "#/$defs/content",
892
+ "minProperties": 1,
893
+ "maxProperties": 1
894
+ }
895
+ },
896
+ "oneOf": [
897
+ {
898
+ "required": ["schema"]
899
+ },
900
+ {
901
+ "required": ["content"]
902
+ }
903
+ ],
904
+ "dependentSchemas": {
905
+ "schema": {
906
+ "properties": {
907
+ "style": {
908
+ "default": "simple",
909
+ "const": "simple"
910
+ },
911
+ "explode": {
912
+ "default": false,
913
+ "type": "boolean"
914
+ }
915
+ },
916
+ "$ref": "#/$defs/examples"
917
+ }
918
+ },
919
+ "$ref": "#/$defs/specification-extensions",
920
+ "unevaluatedProperties": false
921
+ },
922
+ "header-or-reference": {
923
+ "if": {
924
+ "type": "object",
925
+ "required": ["$ref"]
926
+ },
927
+ "then": {
928
+ "$ref": "#/$defs/reference"
929
+ },
930
+ "else": {
931
+ "$ref": "#/$defs/header"
932
+ }
933
+ },
934
+ "tag": {
935
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#tag-object",
936
+ "type": "object",
937
+ "properties": {
938
+ "name": {
939
+ "type": "string"
940
+ },
941
+ "description": {
942
+ "type": "string"
943
+ },
944
+ "externalDocs": {
945
+ "$ref": "#/$defs/external-documentation"
946
+ }
947
+ },
948
+ "required": ["name"],
949
+ "$ref": "#/$defs/specification-extensions",
950
+ "unevaluatedProperties": false
951
+ },
952
+ "reference": {
953
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#reference-object",
954
+ "type": "object",
955
+ "properties": {
956
+ "$ref": {
957
+ "type": "string",
958
+ "format": "uri-reference"
959
+ },
960
+ "summary": {
961
+ "type": "string"
962
+ },
963
+ "description": {
964
+ "type": "string"
965
+ }
966
+ }
967
+ },
968
+ "schema": {
969
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#schema-object",
970
+ "$ref": "https://spec.openapis.org/oas/3.1/dialect/base"
971
+ },
972
+ "security-scheme": {
973
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#security-scheme-object",
974
+ "type": "object",
975
+ "properties": {
976
+ "type": {
977
+ "enum": ["apiKey", "http", "mutualTLS", "oauth2", "openIdConnect"]
978
+ },
979
+ "description": {
980
+ "type": "string"
981
+ }
982
+ },
983
+ "required": ["type"],
984
+ "allOf": [
985
+ {
986
+ "$ref": "#/$defs/specification-extensions"
987
+ },
988
+ {
989
+ "$ref": "#/$defs/security-scheme/$defs/type-apikey"
990
+ },
991
+ {
992
+ "$ref": "#/$defs/security-scheme/$defs/type-http"
993
+ },
994
+ {
995
+ "$ref": "#/$defs/security-scheme/$defs/type-http-bearer"
996
+ },
997
+ {
998
+ "$ref": "#/$defs/security-scheme/$defs/type-oauth2"
999
+ },
1000
+ {
1001
+ "$ref": "#/$defs/security-scheme/$defs/type-oidc"
1002
+ }
1003
+ ],
1004
+ "unevaluatedProperties": false,
1005
+ "$defs": {
1006
+ "type-apikey": {
1007
+ "if": {
1008
+ "properties": {
1009
+ "type": {
1010
+ "const": "apiKey"
1011
+ }
1012
+ },
1013
+ "required": ["type"]
1014
+ },
1015
+ "then": {
1016
+ "properties": {
1017
+ "name": {
1018
+ "type": "string"
1019
+ },
1020
+ "in": {
1021
+ "enum": ["query", "header", "cookie"]
1022
+ }
1023
+ },
1024
+ "required": ["name", "in"]
1025
+ }
1026
+ },
1027
+ "type-http": {
1028
+ "if": {
1029
+ "properties": {
1030
+ "type": {
1031
+ "const": "http"
1032
+ }
1033
+ },
1034
+ "required": ["type"]
1035
+ },
1036
+ "then": {
1037
+ "properties": {
1038
+ "scheme": {
1039
+ "type": "string"
1040
+ }
1041
+ },
1042
+ "required": ["scheme"]
1043
+ }
1044
+ },
1045
+ "type-http-bearer": {
1046
+ "if": {
1047
+ "properties": {
1048
+ "type": {
1049
+ "const": "http"
1050
+ },
1051
+ "scheme": {
1052
+ "type": "string",
1053
+ "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$"
1054
+ }
1055
+ },
1056
+ "required": ["type", "scheme"]
1057
+ },
1058
+ "then": {
1059
+ "properties": {
1060
+ "bearerFormat": {
1061
+ "type": "string"
1062
+ }
1063
+ }
1064
+ }
1065
+ },
1066
+ "type-oauth2": {
1067
+ "if": {
1068
+ "properties": {
1069
+ "type": {
1070
+ "const": "oauth2"
1071
+ }
1072
+ },
1073
+ "required": ["type"]
1074
+ },
1075
+ "then": {
1076
+ "properties": {
1077
+ "flows": {
1078
+ "$ref": "#/$defs/oauth-flows"
1079
+ }
1080
+ },
1081
+ "required": ["flows"]
1082
+ }
1083
+ },
1084
+ "type-oidc": {
1085
+ "if": {
1086
+ "properties": {
1087
+ "type": {
1088
+ "const": "openIdConnect"
1089
+ }
1090
+ },
1091
+ "required": ["type"]
1092
+ },
1093
+ "then": {
1094
+ "properties": {
1095
+ "openIdConnectUrl": {
1096
+ "type": "string",
1097
+ "format": "uri-reference"
1098
+ }
1099
+ },
1100
+ "required": ["openIdConnectUrl"]
1101
+ }
1102
+ }
1103
+ }
1104
+ },
1105
+ "security-scheme-or-reference": {
1106
+ "if": {
1107
+ "type": "object",
1108
+ "required": ["$ref"]
1109
+ },
1110
+ "then": {
1111
+ "$ref": "#/$defs/reference"
1112
+ },
1113
+ "else": {
1114
+ "$ref": "#/$defs/security-scheme"
1115
+ }
1116
+ },
1117
+ "oauth-flows": {
1118
+ "type": "object",
1119
+ "properties": {
1120
+ "implicit": {
1121
+ "$ref": "#/$defs/oauth-flows/$defs/implicit"
1122
+ },
1123
+ "password": {
1124
+ "$ref": "#/$defs/oauth-flows/$defs/password"
1125
+ },
1126
+ "clientCredentials": {
1127
+ "$ref": "#/$defs/oauth-flows/$defs/client-credentials"
1128
+ },
1129
+ "authorizationCode": {
1130
+ "$ref": "#/$defs/oauth-flows/$defs/authorization-code"
1131
+ }
1132
+ },
1133
+ "$ref": "#/$defs/specification-extensions",
1134
+ "unevaluatedProperties": false,
1135
+ "$defs": {
1136
+ "implicit": {
1137
+ "type": "object",
1138
+ "properties": {
1139
+ "authorizationUrl": {
1140
+ "type": "string",
1141
+ "format": "uri-reference"
1142
+ },
1143
+ "refreshUrl": {
1144
+ "type": "string",
1145
+ "format": "uri-reference"
1146
+ },
1147
+ "scopes": {
1148
+ "$ref": "#/$defs/map-of-strings"
1149
+ }
1150
+ },
1151
+ "required": ["authorizationUrl", "scopes"],
1152
+ "$ref": "#/$defs/specification-extensions",
1153
+ "unevaluatedProperties": false
1154
+ },
1155
+ "password": {
1156
+ "type": "object",
1157
+ "properties": {
1158
+ "tokenUrl": {
1159
+ "type": "string",
1160
+ "format": "uri-reference"
1161
+ },
1162
+ "refreshUrl": {
1163
+ "type": "string",
1164
+ "format": "uri-reference"
1165
+ },
1166
+ "scopes": {
1167
+ "$ref": "#/$defs/map-of-strings"
1168
+ }
1169
+ },
1170
+ "required": ["tokenUrl", "scopes"],
1171
+ "$ref": "#/$defs/specification-extensions",
1172
+ "unevaluatedProperties": false
1173
+ },
1174
+ "client-credentials": {
1175
+ "type": "object",
1176
+ "properties": {
1177
+ "tokenUrl": {
1178
+ "type": "string",
1179
+ "format": "uri-reference"
1180
+ },
1181
+ "refreshUrl": {
1182
+ "type": "string",
1183
+ "format": "uri-reference"
1184
+ },
1185
+ "scopes": {
1186
+ "$ref": "#/$defs/map-of-strings"
1187
+ }
1188
+ },
1189
+ "required": ["tokenUrl", "scopes"],
1190
+ "$ref": "#/$defs/specification-extensions",
1191
+ "unevaluatedProperties": false
1192
+ },
1193
+ "authorization-code": {
1194
+ "type": "object",
1195
+ "properties": {
1196
+ "authorizationUrl": {
1197
+ "type": "string",
1198
+ "format": "uri-reference"
1199
+ },
1200
+ "tokenUrl": {
1201
+ "type": "string",
1202
+ "format": "uri-reference"
1203
+ },
1204
+ "refreshUrl": {
1205
+ "type": "string",
1206
+ "format": "uri-reference"
1207
+ },
1208
+ "scopes": {
1209
+ "$ref": "#/$defs/map-of-strings"
1210
+ }
1211
+ },
1212
+ "required": ["authorizationUrl", "tokenUrl", "scopes"],
1213
+ "$ref": "#/$defs/specification-extensions",
1214
+ "unevaluatedProperties": false
1215
+ }
1216
+ }
1217
+ },
1218
+ "security-requirement": {
1219
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#security-requirement-object",
1220
+ "type": "object",
1221
+ "additionalProperties": {
1222
+ "type": "array",
1223
+ "items": {
1224
+ "type": "string"
1225
+ }
1226
+ }
1227
+ },
1228
+ "specification-extensions": {
1229
+ "$comment": "https://spec.openapis.org/oas/v3.1.0#specification-extensions",
1230
+ "patternProperties": {
1231
+ "^x-": true
1232
+ }
1233
+ },
1234
+ "examples": {
1235
+ "properties": {
1236
+ "example": true,
1237
+ "examples": {
1238
+ "type": "object",
1239
+ "additionalProperties": {
1240
+ "$ref": "#/$defs/example-or-reference"
1241
+ }
1242
+ }
1243
+ }
1244
+ },
1245
+ "map-of-strings": {
1246
+ "type": "object",
1247
+ "additionalProperties": {
1248
+ "type": "string"
1249
+ }
1250
+ },
1251
+ "styles-for-form": {
1252
+ "if": {
1253
+ "properties": {
1254
+ "style": {
1255
+ "const": "form"
1256
+ }
1257
+ },
1258
+ "required": ["style"]
1259
+ },
1260
+ "then": {
1261
+ "properties": {
1262
+ "explode": {
1263
+ "default": true
1264
+ }
1265
+ }
1266
+ },
1267
+ "else": {
1268
+ "properties": {
1269
+ "explode": {
1270
+ "default": false
1271
+ }
1272
+ }
1273
+ }
1274
+ }
1275
+ }
1276
+ }