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