open_api-schema_validator 0.1.1 → 0.2.0

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