swaggable 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2e59f7b20f75ff1ecfcf7d6b3533163481aad335
4
+ data.tar.gz: bf2b29d46c656ab268dab1b577bea82aa00d5ef6
5
+ SHA512:
6
+ metadata.gz: d38ea707dab9b2ab8040a32ae9c4fd718d3b3e0a7e128c54897659052a629719c779dab658ed6a4259fab6b81bd4ea18937791e77c10364af59ce63bda86b0d7
7
+ data.tar.gz: 49008f292dae3193e1bdbc8ec492e775fc633f89587a28a171f6ac56379a391f4a4dd55ea70d4b49c6768e9813dd690238ae779ed74b3fa78c7e078b714a01fc
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ Gemfile.lock
2
+ .yardoc
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :test, :development do
6
+ gem 'gem-release'
7
+ gem 'rspec'
8
+ gem 'pry'
9
+ gem 'rerun'
10
+ gem 'grape', '~> 0.11.0'
11
+ gem 'rack-test'
12
+ gem 'yard'
13
+ gem 'webmock'
14
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Manuel Morales, Workshare ltd., et al.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # Swaggable
2
+
3
+ Flexible swagger documentation generation tool.
4
+ Allows building a Rack application that
5
+ serves [Swagger 2](http://swagger.io/) documentation
6
+ from [Grape](https://github.com/intridea/grape) APIs.
7
+
8
+
9
+ ## Getting Started
10
+
11
+ ```ruby
12
+ # my_rack_app.rb
13
+ require 'swaggable'
14
+
15
+ api_def = Swaggable::ApiDefinition.from_grape_api(UsersApi)
16
+ rack_app = Swaggable::RackApp.new(api_definition: api_def)
17
+ ```
18
+
19
+ You can import several Grape APIs:
20
+
21
+ ```ruby
22
+ Swaggable::GrapeAdapter.new.import(UsersApi, api_def)
23
+ Swaggable::GrapeAdapter.new.import(CommentsApi, api_def)
24
+ ```
25
+
26
+ You can tweak the generated ApiDefinition directly:
27
+
28
+ ```ruby
29
+ api_def.title = 'My Service'
30
+ api_def.description = 'Does stuff.'
31
+ api_def.endpoints['GET /users/{id}'].description = 'Show user'
32
+ api_def.endpoints['GET /users/{id}'].tags['Users'].description = 'Users resource'
33
+ api_def.endpoints['GET /users/{id}'].parameters['filter'].description = 'Allows filtering'
34
+ api_def.endpoints['GET /users/{id}'].responses[403].description = 'Forbidden'
35
+ ```
36
+
37
+ Validate the results against the corresponding schema in your tests:
38
+
39
+ ```ruby
40
+ it "validates" do
41
+ expect(rack_app.validate!).to be true
42
+ end
43
+ ```
44
+
45
+ Define the API without Grape:
46
+
47
+ ```ruby
48
+ api = Swaggable::ApiDefinition.new do
49
+ version '1.0'
50
+ title 'My API'
51
+ description 'A test API'
52
+ base_path '/api/1.0'
53
+
54
+ endpoints.add_new do
55
+ path '/users/{id}'
56
+ verb :get
57
+ description 'Shows an user'
58
+ summary 'Returns the JSON representation of such user'
59
+
60
+ tags.add_new do
61
+ name 'Users'
62
+ description 'Users resource'
63
+ end
64
+
65
+ parameters.add_new do
66
+ name 'include_comments_count'
67
+ description 'It will return the comments_count attribute when set to true'
68
+ location :query # [:path, :query, :header, :body, :form, nil]
69
+ required false
70
+ type :boolean # [:string, :number, :integer, :boolean, :array, :file, nil]
71
+ end
72
+
73
+ responses.add_new do
74
+ status 200
75
+ description 'Success'
76
+ end
77
+
78
+ responses.add_new do
79
+ status 404
80
+ description 'User not found'
81
+ end
82
+
83
+ consumes << :json
84
+ produces << :json
85
+ end
86
+ end
87
+ ```
88
+
89
+ ## TODO
90
+
91
+ * Support response specs.
92
+ * Document classes.
93
+ * Include Redirector.
94
+ * DSL.
95
+ * Swagger validation.
96
+ * Request & response validations.
97
+ * Entities & schemas.
98
+
99
+
100
+ ## Contributing
101
+
102
+ Do not forget to run the tests with:
103
+
104
+ ```bash
105
+ rake
106
+ ```
107
+
108
+
109
+ And bump the version with any of:
110
+
111
+ ```bash
112
+ $ gem bump --version 1.1.1 # Bump the gem version to the given version number
113
+ $ gem bump --version major # Bump the gem version to the next major level (e.g. 0.0.1 to 1.0.0)
114
+ $ gem bump --version minor # Bump the gem version to the next minor level (e.g. 0.0.1 to 0.1.0)
115
+ $ gem bump --version patch # Bump the gem version to the next patch level (e.g. 0.0.1 to 0.0.2)
116
+ ```
117
+
118
+
119
+ ## License
120
+
121
+ Released under the MIT License.
122
+ See the [LICENSE](LICENSE.txt) file for further details.
123
+
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake'
3
+
4
+ require 'rspec/core/rake_task'
5
+
6
+ task :default => :spec
7
+
8
+ task :test => :spec
9
+
10
+ desc 'Run all specs'
11
+ RSpec::Core::RakeTask.new('spec') do |spec|
12
+ spec.rspec_opts = %w{}
13
+ end
@@ -0,0 +1,150 @@
1
+ {
2
+ "id": "http://json-schema.org/draft-04/schema#",
3
+ "$schema": "http://json-schema.org/draft-04/schema#",
4
+ "description": "Core schema meta-schema",
5
+ "definitions": {
6
+ "schemaArray": {
7
+ "type": "array",
8
+ "minItems": 1,
9
+ "items": { "$ref": "#" }
10
+ },
11
+ "positiveInteger": {
12
+ "type": "integer",
13
+ "minimum": 0
14
+ },
15
+ "positiveIntegerDefault0": {
16
+ "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
17
+ },
18
+ "simpleTypes": {
19
+ "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
20
+ },
21
+ "stringArray": {
22
+ "type": "array",
23
+ "items": { "type": "string" },
24
+ "minItems": 1,
25
+ "uniqueItems": true
26
+ }
27
+ },
28
+ "type": "object",
29
+ "properties": {
30
+ "id": {
31
+ "type": "string",
32
+ "format": "uri"
33
+ },
34
+ "$schema": {
35
+ "type": "string",
36
+ "format": "uri"
37
+ },
38
+ "title": {
39
+ "type": "string"
40
+ },
41
+ "description": {
42
+ "type": "string"
43
+ },
44
+ "default": {},
45
+ "multipleOf": {
46
+ "type": "number",
47
+ "minimum": 0,
48
+ "exclusiveMinimum": true
49
+ },
50
+ "maximum": {
51
+ "type": "number"
52
+ },
53
+ "exclusiveMaximum": {
54
+ "type": "boolean",
55
+ "default": false
56
+ },
57
+ "minimum": {
58
+ "type": "number"
59
+ },
60
+ "exclusiveMinimum": {
61
+ "type": "boolean",
62
+ "default": false
63
+ },
64
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
65
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
66
+ "pattern": {
67
+ "type": "string",
68
+ "format": "regex"
69
+ },
70
+ "additionalItems": {
71
+ "anyOf": [
72
+ { "type": "boolean" },
73
+ { "$ref": "#" }
74
+ ],
75
+ "default": {}
76
+ },
77
+ "items": {
78
+ "anyOf": [
79
+ { "$ref": "#" },
80
+ { "$ref": "#/definitions/schemaArray" }
81
+ ],
82
+ "default": {}
83
+ },
84
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
85
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
86
+ "uniqueItems": {
87
+ "type": "boolean",
88
+ "default": false
89
+ },
90
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
91
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
92
+ "required": { "$ref": "#/definitions/stringArray" },
93
+ "additionalProperties": {
94
+ "anyOf": [
95
+ { "type": "boolean" },
96
+ { "$ref": "#" }
97
+ ],
98
+ "default": {}
99
+ },
100
+ "definitions": {
101
+ "type": "object",
102
+ "additionalProperties": { "$ref": "#" },
103
+ "default": {}
104
+ },
105
+ "properties": {
106
+ "type": "object",
107
+ "additionalProperties": { "$ref": "#" },
108
+ "default": {}
109
+ },
110
+ "patternProperties": {
111
+ "type": "object",
112
+ "additionalProperties": { "$ref": "#" },
113
+ "default": {}
114
+ },
115
+ "dependencies": {
116
+ "type": "object",
117
+ "additionalProperties": {
118
+ "anyOf": [
119
+ { "$ref": "#" },
120
+ { "$ref": "#/definitions/stringArray" }
121
+ ]
122
+ }
123
+ },
124
+ "enum": {
125
+ "type": "array",
126
+ "minItems": 1,
127
+ "uniqueItems": true
128
+ },
129
+ "type": {
130
+ "anyOf": [
131
+ { "$ref": "#/definitions/simpleTypes" },
132
+ {
133
+ "type": "array",
134
+ "items": { "$ref": "#/definitions/simpleTypes" },
135
+ "minItems": 1,
136
+ "uniqueItems": true
137
+ }
138
+ ]
139
+ },
140
+ "allOf": { "$ref": "#/definitions/schemaArray" },
141
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
142
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
143
+ "not": { "$ref": "#" }
144
+ },
145
+ "dependencies": {
146
+ "exclusiveMaximum": [ "maximum" ],
147
+ "exclusiveMinimum": [ "minimum" ]
148
+ },
149
+ "default": {}
150
+ }
@@ -0,0 +1,1495 @@
1
+ {
2
+ "title": "A JSON Schema for Swagger 2.0 API.",
3
+ "id": "http://swagger.io/v2/schema.json#",
4
+ "$schema": "http://json-schema.org/draft-04/schema#",
5
+ "type": "object",
6
+ "required": [
7
+ "swagger",
8
+ "info",
9
+ "paths"
10
+ ],
11
+ "additionalProperties": false,
12
+ "patternProperties": {
13
+ "^x-": {
14
+ "$ref": "#/definitions/vendorExtension"
15
+ }
16
+ },
17
+ "properties": {
18
+ "swagger": {
19
+ "type": "string",
20
+ "enum": [
21
+ "2.0"
22
+ ],
23
+ "description": "The Swagger version of this document."
24
+ },
25
+ "info": {
26
+ "$ref": "#/definitions/info"
27
+ },
28
+ "host": {
29
+ "type": "string",
30
+ "format": "uri",
31
+ "pattern": "^[^{}/ :\\\\]+(?::\\d+)?$",
32
+ "description": "The fully qualified URI to the host of the API."
33
+ },
34
+ "basePath": {
35
+ "type": "string",
36
+ "pattern": "^/",
37
+ "description": "The base path to the API. Example: '/api'."
38
+ },
39
+ "schemes": {
40
+ "$ref": "#/definitions/schemesList"
41
+ },
42
+ "consumes": {
43
+ "description": "A list of MIME types accepted by the API.",
44
+ "$ref": "#/definitions/mediaTypeList"
45
+ },
46
+ "produces": {
47
+ "description": "A list of MIME types the API can produce.",
48
+ "$ref": "#/definitions/mediaTypeList"
49
+ },
50
+ "paths": {
51
+ "$ref": "#/definitions/paths"
52
+ },
53
+ "definitions": {
54
+ "$ref": "#/definitions/definitions"
55
+ },
56
+ "parameters": {
57
+ "$ref": "#/definitions/parameterDefinitions"
58
+ },
59
+ "responses": {
60
+ "$ref": "#/definitions/responseDefinitions"
61
+ },
62
+ "security": {
63
+ "$ref": "#/definitions/security"
64
+ },
65
+ "securityDefinitions": {
66
+ "$ref": "#/definitions/securityDefinitions"
67
+ },
68
+ "tags": {
69
+ "type": "array",
70
+ "items": {
71
+ "$ref": "#/definitions/tag"
72
+ },
73
+ "uniqueItems": true
74
+ },
75
+ "externalDocs": {
76
+ "$ref": "#/definitions/externalDocs"
77
+ }
78
+ },
79
+ "definitions": {
80
+ "info": {
81
+ "type": "object",
82
+ "description": "General information about the API.",
83
+ "required": [
84
+ "version",
85
+ "title"
86
+ ],
87
+ "additionalProperties": false,
88
+ "patternProperties": {
89
+ "^x-": {
90
+ "$ref": "#/definitions/vendorExtension"
91
+ }
92
+ },
93
+ "properties": {
94
+ "title": {
95
+ "type": "string",
96
+ "description": "A unique and precise title of the API."
97
+ },
98
+ "version": {
99
+ "type": "string",
100
+ "description": "A semantic version number of the API."
101
+ },
102
+ "description": {
103
+ "type": "string",
104
+ "description": "A longer description of the API. Should be different from the title. Github-flavored markdown is allowed."
105
+ },
106
+ "termsOfService": {
107
+ "type": "string",
108
+ "description": "The terms of service for the API."
109
+ },
110
+ "contact": {
111
+ "$ref": "#/definitions/contact"
112
+ },
113
+ "license": {
114
+ "$ref": "#/definitions/license"
115
+ }
116
+ }
117
+ },
118
+ "contact": {
119
+ "type": "object",
120
+ "description": "Contact information for the owners of the API.",
121
+ "additionalProperties": false,
122
+ "properties": {
123
+ "name": {
124
+ "type": "string",
125
+ "description": "The identifying name of the contact person/organization."
126
+ },
127
+ "url": {
128
+ "type": "string",
129
+ "description": "The URL pointing to the contact information.",
130
+ "format": "uri"
131
+ },
132
+ "email": {
133
+ "type": "string",
134
+ "description": "The email address of the contact person/organization.",
135
+ "format": "email"
136
+ }
137
+ }
138
+ },
139
+ "license": {
140
+ "type": "object",
141
+ "required": [
142
+ "name"
143
+ ],
144
+ "additionalProperties": false,
145
+ "properties": {
146
+ "name": {
147
+ "type": "string",
148
+ "description": "The name of the license type. It's encouraged to use an OSI compatible license."
149
+ },
150
+ "url": {
151
+ "type": "string",
152
+ "description": "The URL pointing to the license.",
153
+ "format": "uri"
154
+ }
155
+ }
156
+ },
157
+ "paths": {
158
+ "type": "object",
159
+ "description": "Relative paths to the individual endpoints. They must be relative to the 'basePath'.",
160
+ "patternProperties": {
161
+ "^x-": {
162
+ "$ref": "#/definitions/vendorExtension"
163
+ },
164
+ "^/": {
165
+ "$ref": "#/definitions/pathItem"
166
+ }
167
+ },
168
+ "additionalProperties": false
169
+ },
170
+ "definitions": {
171
+ "type": "object",
172
+ "additionalProperties": {
173
+ "$ref": "#/definitions/schema"
174
+ },
175
+ "description": "One or more JSON objects describing the schemas being consumed and produced by the API."
176
+ },
177
+ "parameterDefinitions": {
178
+ "type": "object",
179
+ "additionalProperties": {
180
+ "$ref": "#/definitions/parameter"
181
+ },
182
+ "description": "One or more JSON representations for parameters"
183
+ },
184
+ "responseDefinitions": {
185
+ "type": "object",
186
+ "additionalProperties": {
187
+ "$ref": "#/definitions/response"
188
+ },
189
+ "description": "One or more JSON representations for parameters"
190
+ },
191
+ "externalDocs": {
192
+ "type": "object",
193
+ "additionalProperties": false,
194
+ "description": "information about external documentation",
195
+ "required": [
196
+ "url"
197
+ ],
198
+ "properties": {
199
+ "description": {
200
+ "type": "string"
201
+ },
202
+ "url": {
203
+ "type": "string",
204
+ "format": "uri"
205
+ }
206
+ }
207
+ },
208
+ "examples": {
209
+ "type": "object",
210
+ "patternProperties": {
211
+ "^[a-z0-9-]+/[a-z0-9\\-+]+$": {}
212
+ },
213
+ "additionalProperties": false
214
+ },
215
+ "mimeType": {
216
+ "type": "string",
217
+ "description": "The MIME type of the HTTP message."
218
+ },
219
+ "operation": {
220
+ "type": "object",
221
+ "required": [
222
+ "responses"
223
+ ],
224
+ "additionalProperties": false,
225
+ "patternProperties": {
226
+ "^x-": {
227
+ "$ref": "#/definitions/vendorExtension"
228
+ }
229
+ },
230
+ "properties": {
231
+ "tags": {
232
+ "type": "array",
233
+ "items": {
234
+ "type": "string"
235
+ },
236
+ "uniqueItems": true
237
+ },
238
+ "summary": {
239
+ "type": "string",
240
+ "description": "A brief summary of the operation."
241
+ },
242
+ "description": {
243
+ "type": "string",
244
+ "description": "A longer description of the operation, github-flavored markdown is allowed."
245
+ },
246
+ "externalDocs": {
247
+ "$ref": "#/definitions/externalDocs"
248
+ },
249
+ "operationId": {
250
+ "type": "string",
251
+ "description": "A friendly name of the operation"
252
+ },
253
+ "produces": {
254
+ "description": "A list of MIME types the API can produce.",
255
+ "$ref": "#/definitions/mediaTypeList"
256
+ },
257
+ "consumes": {
258
+ "description": "A list of MIME types the API can consume.",
259
+ "$ref": "#/definitions/mediaTypeList"
260
+ },
261
+ "parameters": {
262
+ "$ref": "#/definitions/parametersList"
263
+ },
264
+ "responses": {
265
+ "$ref": "#/definitions/responses"
266
+ },
267
+ "schemes": {
268
+ "$ref": "#/definitions/schemesList"
269
+ },
270
+ "deprecated": {
271
+ "type": "boolean",
272
+ "default": false
273
+ },
274
+ "security": {
275
+ "$ref": "#/definitions/security"
276
+ }
277
+ }
278
+ },
279
+ "pathItem": {
280
+ "type": "object",
281
+ "additionalProperties": false,
282
+ "patternProperties": {
283
+ "^x-": {
284
+ "$ref": "#/definitions/vendorExtension"
285
+ }
286
+ },
287
+ "properties": {
288
+ "$ref": {
289
+ "type": "string"
290
+ },
291
+ "get": {
292
+ "$ref": "#/definitions/operation"
293
+ },
294
+ "put": {
295
+ "$ref": "#/definitions/operation"
296
+ },
297
+ "post": {
298
+ "$ref": "#/definitions/operation"
299
+ },
300
+ "delete": {
301
+ "$ref": "#/definitions/operation"
302
+ },
303
+ "options": {
304
+ "$ref": "#/definitions/operation"
305
+ },
306
+ "head": {
307
+ "$ref": "#/definitions/operation"
308
+ },
309
+ "patch": {
310
+ "$ref": "#/definitions/operation"
311
+ },
312
+ "parameters": {
313
+ "$ref": "#/definitions/parametersList"
314
+ }
315
+ }
316
+ },
317
+ "responses": {
318
+ "type": "object",
319
+ "description": "Response objects names can either be any valid HTTP status code or 'default'.",
320
+ "minProperties": 1,
321
+ "additionalProperties": false,
322
+ "patternProperties": {
323
+ "^([0-9]{3})$|^(default)$": {
324
+ "$ref": "#/definitions/responseValue"
325
+ },
326
+ "^x-": {
327
+ "$ref": "#/definitions/vendorExtension"
328
+ }
329
+ },
330
+ "not": {
331
+ "type": "object",
332
+ "additionalProperties": false,
333
+ "patternProperties": {
334
+ "^x-": {
335
+ "$ref": "#/definitions/vendorExtension"
336
+ }
337
+ }
338
+ }
339
+ },
340
+ "responseValue": {
341
+ "oneOf": [
342
+ {
343
+ "$ref": "#/definitions/response"
344
+ },
345
+ {
346
+ "$ref": "#/definitions/jsonReference"
347
+ }
348
+ ]
349
+ },
350
+ "response": {
351
+ "type": "object",
352
+ "required": [
353
+ "description"
354
+ ],
355
+ "properties": {
356
+ "description": {
357
+ "type": "string"
358
+ },
359
+ "schema": {
360
+ "$ref": "#/definitions/schema"
361
+ },
362
+ "headers": {
363
+ "$ref": "#/definitions/headers"
364
+ },
365
+ "examples": {
366
+ "$ref": "#/definitions/examples"
367
+ }
368
+ },
369
+ "additionalProperties": false
370
+ },
371
+ "headers": {
372
+ "type": "object",
373
+ "additionalProperties": {
374
+ "$ref": "#/definitions/header"
375
+ }
376
+ },
377
+ "header": {
378
+ "type": "object",
379
+ "additionalProperties": false,
380
+ "required": [
381
+ "type"
382
+ ],
383
+ "properties": {
384
+ "type": {
385
+ "type": "string",
386
+ "enum": [
387
+ "string",
388
+ "number",
389
+ "integer",
390
+ "boolean",
391
+ "array"
392
+ ]
393
+ },
394
+ "format": {
395
+ "type": "string"
396
+ },
397
+ "items": {
398
+ "$ref": "#/definitions/primitivesItems"
399
+ },
400
+ "collectionFormat": {
401
+ "$ref": "#/definitions/collectionFormat"
402
+ },
403
+ "default": {
404
+ "$ref": "#/definitions/default"
405
+ },
406
+ "maximum": {
407
+ "$ref": "#/definitions/maximum"
408
+ },
409
+ "exclusiveMaximum": {
410
+ "$ref": "#/definitions/exclusiveMaximum"
411
+ },
412
+ "minimum": {
413
+ "$ref": "#/definitions/minimum"
414
+ },
415
+ "exclusiveMinimum": {
416
+ "$ref": "#/definitions/exclusiveMinimum"
417
+ },
418
+ "maxLength": {
419
+ "$ref": "#/definitions/maxLength"
420
+ },
421
+ "minLength": {
422
+ "$ref": "#/definitions/minLength"
423
+ },
424
+ "pattern": {
425
+ "$ref": "#/definitions/pattern"
426
+ },
427
+ "maxItems": {
428
+ "$ref": "#/definitions/maxItems"
429
+ },
430
+ "minItems": {
431
+ "$ref": "#/definitions/minItems"
432
+ },
433
+ "uniqueItems": {
434
+ "$ref": "#/definitions/uniqueItems"
435
+ },
436
+ "enum": {
437
+ "$ref": "#/definitions/enum"
438
+ },
439
+ "multipleOf": {
440
+ "$ref": "#/definitions/multipleOf"
441
+ },
442
+ "description": {
443
+ "type": "string"
444
+ }
445
+ }
446
+ },
447
+ "vendorExtension": {
448
+ "description": "Any property starting with x- is valid.",
449
+ "additionalProperties": true,
450
+ "additionalItems": true
451
+ },
452
+ "bodyParameter": {
453
+ "type": "object",
454
+ "required": [
455
+ "name",
456
+ "in",
457
+ "schema"
458
+ ],
459
+ "patternProperties": {
460
+ "^x-": {
461
+ "$ref": "#/definitions/vendorExtension"
462
+ }
463
+ },
464
+ "properties": {
465
+ "description": {
466
+ "type": "string",
467
+ "description": "A brief description of the parameter. This could contain examples of use. Github-flavored markdown is allowed."
468
+ },
469
+ "name": {
470
+ "type": "string",
471
+ "description": "The name of the parameter."
472
+ },
473
+ "in": {
474
+ "type": "string",
475
+ "description": "Determines the location of the parameter.",
476
+ "enum": [
477
+ "body"
478
+ ]
479
+ },
480
+ "required": {
481
+ "type": "boolean",
482
+ "description": "Determines whether or not this parameter is required or optional.",
483
+ "default": false
484
+ },
485
+ "schema": {
486
+ "$ref": "#/definitions/schema"
487
+ }
488
+ },
489
+ "additionalProperties": false
490
+ },
491
+ "headerParameterSubSchema": {
492
+ "additionalProperties": false,
493
+ "patternProperties": {
494
+ "^x-": {
495
+ "$ref": "#/definitions/vendorExtension"
496
+ }
497
+ },
498
+ "properties": {
499
+ "required": {
500
+ "type": "boolean",
501
+ "description": "Determines whether or not this parameter is required or optional.",
502
+ "default": false
503
+ },
504
+ "in": {
505
+ "type": "string",
506
+ "description": "Determines the location of the parameter.",
507
+ "enum": [
508
+ "header"
509
+ ]
510
+ },
511
+ "description": {
512
+ "type": "string",
513
+ "description": "A brief description of the parameter. This could contain examples of use. Github-flavored markdown is allowed."
514
+ },
515
+ "name": {
516
+ "type": "string",
517
+ "description": "The name of the parameter."
518
+ },
519
+ "type": {
520
+ "type": "string",
521
+ "enum": [
522
+ "string",
523
+ "number",
524
+ "boolean",
525
+ "integer",
526
+ "array"
527
+ ]
528
+ },
529
+ "format": {
530
+ "type": "string"
531
+ },
532
+ "items": {
533
+ "$ref": "#/definitions/primitivesItems"
534
+ },
535
+ "collectionFormat": {
536
+ "$ref": "#/definitions/collectionFormat"
537
+ },
538
+ "default": {
539
+ "$ref": "#/definitions/default"
540
+ },
541
+ "maximum": {
542
+ "$ref": "#/definitions/maximum"
543
+ },
544
+ "exclusiveMaximum": {
545
+ "$ref": "#/definitions/exclusiveMaximum"
546
+ },
547
+ "minimum": {
548
+ "$ref": "#/definitions/minimum"
549
+ },
550
+ "exclusiveMinimum": {
551
+ "$ref": "#/definitions/exclusiveMinimum"
552
+ },
553
+ "maxLength": {
554
+ "$ref": "#/definitions/maxLength"
555
+ },
556
+ "minLength": {
557
+ "$ref": "#/definitions/minLength"
558
+ },
559
+ "pattern": {
560
+ "$ref": "#/definitions/pattern"
561
+ },
562
+ "maxItems": {
563
+ "$ref": "#/definitions/maxItems"
564
+ },
565
+ "minItems": {
566
+ "$ref": "#/definitions/minItems"
567
+ },
568
+ "uniqueItems": {
569
+ "$ref": "#/definitions/uniqueItems"
570
+ },
571
+ "enum": {
572
+ "$ref": "#/definitions/enum"
573
+ },
574
+ "multipleOf": {
575
+ "$ref": "#/definitions/multipleOf"
576
+ }
577
+ }
578
+ },
579
+ "queryParameterSubSchema": {
580
+ "additionalProperties": false,
581
+ "patternProperties": {
582
+ "^x-": {
583
+ "$ref": "#/definitions/vendorExtension"
584
+ }
585
+ },
586
+ "properties": {
587
+ "required": {
588
+ "type": "boolean",
589
+ "description": "Determines whether or not this parameter is required or optional.",
590
+ "default": false
591
+ },
592
+ "in": {
593
+ "type": "string",
594
+ "description": "Determines the location of the parameter.",
595
+ "enum": [
596
+ "query"
597
+ ]
598
+ },
599
+ "description": {
600
+ "type": "string",
601
+ "description": "A brief description of the parameter. This could contain examples of use. Github-flavored markdown is allowed."
602
+ },
603
+ "name": {
604
+ "type": "string",
605
+ "description": "The name of the parameter."
606
+ },
607
+ "allowEmptyValue": {
608
+ "type": "boolean",
609
+ "default": false,
610
+ "description": "allows sending a parameter by name only or with an empty value."
611
+ },
612
+ "type": {
613
+ "type": "string",
614
+ "enum": [
615
+ "string",
616
+ "number",
617
+ "boolean",
618
+ "integer",
619
+ "array"
620
+ ]
621
+ },
622
+ "format": {
623
+ "type": "string"
624
+ },
625
+ "items": {
626
+ "$ref": "#/definitions/primitivesItems"
627
+ },
628
+ "collectionFormat": {
629
+ "$ref": "#/definitions/collectionFormatWithMulti"
630
+ },
631
+ "default": {
632
+ "$ref": "#/definitions/default"
633
+ },
634
+ "maximum": {
635
+ "$ref": "#/definitions/maximum"
636
+ },
637
+ "exclusiveMaximum": {
638
+ "$ref": "#/definitions/exclusiveMaximum"
639
+ },
640
+ "minimum": {
641
+ "$ref": "#/definitions/minimum"
642
+ },
643
+ "exclusiveMinimum": {
644
+ "$ref": "#/definitions/exclusiveMinimum"
645
+ },
646
+ "maxLength": {
647
+ "$ref": "#/definitions/maxLength"
648
+ },
649
+ "minLength": {
650
+ "$ref": "#/definitions/minLength"
651
+ },
652
+ "pattern": {
653
+ "$ref": "#/definitions/pattern"
654
+ },
655
+ "maxItems": {
656
+ "$ref": "#/definitions/maxItems"
657
+ },
658
+ "minItems": {
659
+ "$ref": "#/definitions/minItems"
660
+ },
661
+ "uniqueItems": {
662
+ "$ref": "#/definitions/uniqueItems"
663
+ },
664
+ "enum": {
665
+ "$ref": "#/definitions/enum"
666
+ },
667
+ "multipleOf": {
668
+ "$ref": "#/definitions/multipleOf"
669
+ }
670
+ }
671
+ },
672
+ "formDataParameterSubSchema": {
673
+ "additionalProperties": false,
674
+ "patternProperties": {
675
+ "^x-": {
676
+ "$ref": "#/definitions/vendorExtension"
677
+ }
678
+ },
679
+ "properties": {
680
+ "required": {
681
+ "type": "boolean",
682
+ "description": "Determines whether or not this parameter is required or optional.",
683
+ "default": false
684
+ },
685
+ "in": {
686
+ "type": "string",
687
+ "description": "Determines the location of the parameter.",
688
+ "enum": [
689
+ "formData"
690
+ ]
691
+ },
692
+ "description": {
693
+ "type": "string",
694
+ "description": "A brief description of the parameter. This could contain examples of use. Github-flavored markdown is allowed."
695
+ },
696
+ "name": {
697
+ "type": "string",
698
+ "description": "The name of the parameter."
699
+ },
700
+ "allowEmptyValue": {
701
+ "type": "boolean",
702
+ "default": false,
703
+ "description": "allows sending a parameter by name only or with an empty value."
704
+ },
705
+ "type": {
706
+ "type": "string",
707
+ "enum": [
708
+ "string",
709
+ "number",
710
+ "boolean",
711
+ "integer",
712
+ "array",
713
+ "file"
714
+ ]
715
+ },
716
+ "format": {
717
+ "type": "string"
718
+ },
719
+ "items": {
720
+ "$ref": "#/definitions/primitivesItems"
721
+ },
722
+ "collectionFormat": {
723
+ "$ref": "#/definitions/collectionFormatWithMulti"
724
+ },
725
+ "default": {
726
+ "$ref": "#/definitions/default"
727
+ },
728
+ "maximum": {
729
+ "$ref": "#/definitions/maximum"
730
+ },
731
+ "exclusiveMaximum": {
732
+ "$ref": "#/definitions/exclusiveMaximum"
733
+ },
734
+ "minimum": {
735
+ "$ref": "#/definitions/minimum"
736
+ },
737
+ "exclusiveMinimum": {
738
+ "$ref": "#/definitions/exclusiveMinimum"
739
+ },
740
+ "maxLength": {
741
+ "$ref": "#/definitions/maxLength"
742
+ },
743
+ "minLength": {
744
+ "$ref": "#/definitions/minLength"
745
+ },
746
+ "pattern": {
747
+ "$ref": "#/definitions/pattern"
748
+ },
749
+ "maxItems": {
750
+ "$ref": "#/definitions/maxItems"
751
+ },
752
+ "minItems": {
753
+ "$ref": "#/definitions/minItems"
754
+ },
755
+ "uniqueItems": {
756
+ "$ref": "#/definitions/uniqueItems"
757
+ },
758
+ "enum": {
759
+ "$ref": "#/definitions/enum"
760
+ },
761
+ "multipleOf": {
762
+ "$ref": "#/definitions/multipleOf"
763
+ }
764
+ }
765
+ },
766
+ "pathParameterSubSchema": {
767
+ "additionalProperties": false,
768
+ "patternProperties": {
769
+ "^x-": {
770
+ "$ref": "#/definitions/vendorExtension"
771
+ }
772
+ },
773
+ "properties": {
774
+ "required": {
775
+ "type": "boolean",
776
+ "enum": [
777
+ true
778
+ ],
779
+ "description": "Determines whether or not this parameter is required or optional."
780
+ },
781
+ "in": {
782
+ "type": "string",
783
+ "description": "Determines the location of the parameter.",
784
+ "enum": [
785
+ "path"
786
+ ]
787
+ },
788
+ "description": {
789
+ "type": "string",
790
+ "description": "A brief description of the parameter. This could contain examples of use. Github-flavored markdown is allowed."
791
+ },
792
+ "name": {
793
+ "type": "string",
794
+ "description": "The name of the parameter."
795
+ },
796
+ "type": {
797
+ "type": "string",
798
+ "enum": [
799
+ "string",
800
+ "number",
801
+ "boolean",
802
+ "integer",
803
+ "array"
804
+ ]
805
+ },
806
+ "format": {
807
+ "type": "string"
808
+ },
809
+ "items": {
810
+ "$ref": "#/definitions/primitivesItems"
811
+ },
812
+ "collectionFormat": {
813
+ "$ref": "#/definitions/collectionFormat"
814
+ },
815
+ "default": {
816
+ "$ref": "#/definitions/default"
817
+ },
818
+ "maximum": {
819
+ "$ref": "#/definitions/maximum"
820
+ },
821
+ "exclusiveMaximum": {
822
+ "$ref": "#/definitions/exclusiveMaximum"
823
+ },
824
+ "minimum": {
825
+ "$ref": "#/definitions/minimum"
826
+ },
827
+ "exclusiveMinimum": {
828
+ "$ref": "#/definitions/exclusiveMinimum"
829
+ },
830
+ "maxLength": {
831
+ "$ref": "#/definitions/maxLength"
832
+ },
833
+ "minLength": {
834
+ "$ref": "#/definitions/minLength"
835
+ },
836
+ "pattern": {
837
+ "$ref": "#/definitions/pattern"
838
+ },
839
+ "maxItems": {
840
+ "$ref": "#/definitions/maxItems"
841
+ },
842
+ "minItems": {
843
+ "$ref": "#/definitions/minItems"
844
+ },
845
+ "uniqueItems": {
846
+ "$ref": "#/definitions/uniqueItems"
847
+ },
848
+ "enum": {
849
+ "$ref": "#/definitions/enum"
850
+ },
851
+ "multipleOf": {
852
+ "$ref": "#/definitions/multipleOf"
853
+ }
854
+ }
855
+ },
856
+ "nonBodyParameter": {
857
+ "type": "object",
858
+ "required": [
859
+ "name",
860
+ "in",
861
+ "type"
862
+ ],
863
+ "oneOf": [
864
+ {
865
+ "$ref": "#/definitions/headerParameterSubSchema"
866
+ },
867
+ {
868
+ "$ref": "#/definitions/formDataParameterSubSchema"
869
+ },
870
+ {
871
+ "$ref": "#/definitions/queryParameterSubSchema"
872
+ },
873
+ {
874
+ "$ref": "#/definitions/pathParameterSubSchema"
875
+ }
876
+ ]
877
+ },
878
+ "parameter": {
879
+ "oneOf": [
880
+ {
881
+ "$ref": "#/definitions/bodyParameter"
882
+ },
883
+ {
884
+ "$ref": "#/definitions/nonBodyParameter"
885
+ }
886
+ ]
887
+ },
888
+ "schema": {
889
+ "type": "object",
890
+ "description": "A deterministic version of a JSON Schema object.",
891
+ "patternProperties": {
892
+ "^x-": {
893
+ "$ref": "#/definitions/vendorExtension"
894
+ }
895
+ },
896
+ "properties": {
897
+ "$ref": {
898
+ "type": "string"
899
+ },
900
+ "format": {
901
+ "type": "string"
902
+ },
903
+ "title": {
904
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
905
+ },
906
+ "description": {
907
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
908
+ },
909
+ "default": {
910
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
911
+ },
912
+ "multipleOf": {
913
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
914
+ },
915
+ "maximum": {
916
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
917
+ },
918
+ "exclusiveMaximum": {
919
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
920
+ },
921
+ "minimum": {
922
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
923
+ },
924
+ "exclusiveMinimum": {
925
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
926
+ },
927
+ "maxLength": {
928
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
929
+ },
930
+ "minLength": {
931
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
932
+ },
933
+ "pattern": {
934
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
935
+ },
936
+ "maxItems": {
937
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
938
+ },
939
+ "minItems": {
940
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
941
+ },
942
+ "uniqueItems": {
943
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
944
+ },
945
+ "maxProperties": {
946
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
947
+ },
948
+ "minProperties": {
949
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
950
+ },
951
+ "required": {
952
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/stringArray"
953
+ },
954
+ "enum": {
955
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
956
+ },
957
+ "additionalProperties": {
958
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/additionalProperties"
959
+ },
960
+ "type": {
961
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/type"
962
+ },
963
+ "items": {
964
+ "anyOf": [
965
+ {
966
+ "$ref": "#/definitions/schema"
967
+ },
968
+ {
969
+ "type": "array",
970
+ "minItems": 1,
971
+ "items": {
972
+ "$ref": "#/definitions/schema"
973
+ }
974
+ }
975
+ ],
976
+ "default": {}
977
+ },
978
+ "allOf": {
979
+ "type": "array",
980
+ "minItems": 1,
981
+ "items": {
982
+ "$ref": "#/definitions/schema"
983
+ }
984
+ },
985
+ "properties": {
986
+ "type": "object",
987
+ "additionalProperties": {
988
+ "$ref": "#/definitions/schema"
989
+ },
990
+ "default": {}
991
+ },
992
+ "discriminator": {
993
+ "type": "string"
994
+ },
995
+ "readOnly": {
996
+ "type": "boolean",
997
+ "default": false
998
+ },
999
+ "xml": {
1000
+ "$ref": "#/definitions/xml"
1001
+ },
1002
+ "externalDocs": {
1003
+ "$ref": "#/definitions/externalDocs"
1004
+ },
1005
+ "example": {}
1006
+ },
1007
+ "additionalProperties": false
1008
+ },
1009
+ "primitivesItems": {
1010
+ "type": "object",
1011
+ "additionalProperties": false,
1012
+ "properties": {
1013
+ "type": {
1014
+ "type": "string",
1015
+ "enum": [
1016
+ "string",
1017
+ "number",
1018
+ "integer",
1019
+ "boolean",
1020
+ "array"
1021
+ ]
1022
+ },
1023
+ "format": {
1024
+ "type": "string"
1025
+ },
1026
+ "items": {
1027
+ "$ref": "#/definitions/primitivesItems"
1028
+ },
1029
+ "collectionFormat": {
1030
+ "$ref": "#/definitions/collectionFormat"
1031
+ },
1032
+ "default": {
1033
+ "$ref": "#/definitions/default"
1034
+ },
1035
+ "maximum": {
1036
+ "$ref": "#/definitions/maximum"
1037
+ },
1038
+ "exclusiveMaximum": {
1039
+ "$ref": "#/definitions/exclusiveMaximum"
1040
+ },
1041
+ "minimum": {
1042
+ "$ref": "#/definitions/minimum"
1043
+ },
1044
+ "exclusiveMinimum": {
1045
+ "$ref": "#/definitions/exclusiveMinimum"
1046
+ },
1047
+ "maxLength": {
1048
+ "$ref": "#/definitions/maxLength"
1049
+ },
1050
+ "minLength": {
1051
+ "$ref": "#/definitions/minLength"
1052
+ },
1053
+ "pattern": {
1054
+ "$ref": "#/definitions/pattern"
1055
+ },
1056
+ "maxItems": {
1057
+ "$ref": "#/definitions/maxItems"
1058
+ },
1059
+ "minItems": {
1060
+ "$ref": "#/definitions/minItems"
1061
+ },
1062
+ "uniqueItems": {
1063
+ "$ref": "#/definitions/uniqueItems"
1064
+ },
1065
+ "enum": {
1066
+ "$ref": "#/definitions/enum"
1067
+ },
1068
+ "multipleOf": {
1069
+ "$ref": "#/definitions/multipleOf"
1070
+ }
1071
+ }
1072
+ },
1073
+ "security": {
1074
+ "type": "array",
1075
+ "items": {
1076
+ "$ref": "#/definitions/securityRequirement"
1077
+ },
1078
+ "uniqueItems": true
1079
+ },
1080
+ "securityRequirement": {
1081
+ "type": "object",
1082
+ "additionalProperties": {
1083
+ "type": "array",
1084
+ "items": {
1085
+ "type": "string"
1086
+ },
1087
+ "uniqueItems": true
1088
+ }
1089
+ },
1090
+ "xml": {
1091
+ "type": "object",
1092
+ "additionalProperties": false,
1093
+ "properties": {
1094
+ "name": {
1095
+ "type": "string"
1096
+ },
1097
+ "namespace": {
1098
+ "type": "string"
1099
+ },
1100
+ "prefix": {
1101
+ "type": "string"
1102
+ },
1103
+ "attribute": {
1104
+ "type": "boolean",
1105
+ "default": false
1106
+ },
1107
+ "wrapped": {
1108
+ "type": "boolean",
1109
+ "default": false
1110
+ }
1111
+ }
1112
+ },
1113
+ "tag": {
1114
+ "type": "object",
1115
+ "additionalProperties": false,
1116
+ "required": [
1117
+ "name"
1118
+ ],
1119
+ "properties": {
1120
+ "name": {
1121
+ "type": "string"
1122
+ },
1123
+ "description": {
1124
+ "type": "string"
1125
+ },
1126
+ "externalDocs": {
1127
+ "$ref": "#/definitions/externalDocs"
1128
+ }
1129
+ },
1130
+ "patternProperties": {
1131
+ "^x-": {
1132
+ "$ref": "#/definitions/vendorExtension"
1133
+ }
1134
+ }
1135
+ },
1136
+ "securityDefinitions": {
1137
+ "type": "object",
1138
+ "additionalProperties": {
1139
+ "oneOf": [
1140
+ {
1141
+ "$ref": "#/definitions/basicAuthenticationSecurity"
1142
+ },
1143
+ {
1144
+ "$ref": "#/definitions/apiKeySecurity"
1145
+ },
1146
+ {
1147
+ "$ref": "#/definitions/oauth2ImplicitSecurity"
1148
+ },
1149
+ {
1150
+ "$ref": "#/definitions/oauth2PasswordSecurity"
1151
+ },
1152
+ {
1153
+ "$ref": "#/definitions/oauth2ApplicationSecurity"
1154
+ },
1155
+ {
1156
+ "$ref": "#/definitions/oauth2AccessCodeSecurity"
1157
+ }
1158
+ ]
1159
+ }
1160
+ },
1161
+ "basicAuthenticationSecurity": {
1162
+ "type": "object",
1163
+ "additionalProperties": false,
1164
+ "required": [
1165
+ "type"
1166
+ ],
1167
+ "properties": {
1168
+ "type": {
1169
+ "type": "string",
1170
+ "enum": [
1171
+ "basic"
1172
+ ]
1173
+ },
1174
+ "description": {
1175
+ "type": "string"
1176
+ }
1177
+ },
1178
+ "patternProperties": {
1179
+ "^x-": {
1180
+ "$ref": "#/definitions/vendorExtension"
1181
+ }
1182
+ }
1183
+ },
1184
+ "apiKeySecurity": {
1185
+ "type": "object",
1186
+ "additionalProperties": false,
1187
+ "required": [
1188
+ "type",
1189
+ "name",
1190
+ "in"
1191
+ ],
1192
+ "properties": {
1193
+ "type": {
1194
+ "type": "string",
1195
+ "enum": [
1196
+ "apiKey"
1197
+ ]
1198
+ },
1199
+ "name": {
1200
+ "type": "string"
1201
+ },
1202
+ "in": {
1203
+ "type": "string",
1204
+ "enum": [
1205
+ "header",
1206
+ "query"
1207
+ ]
1208
+ },
1209
+ "description": {
1210
+ "type": "string"
1211
+ }
1212
+ },
1213
+ "patternProperties": {
1214
+ "^x-": {
1215
+ "$ref": "#/definitions/vendorExtension"
1216
+ }
1217
+ }
1218
+ },
1219
+ "oauth2ImplicitSecurity": {
1220
+ "type": "object",
1221
+ "additionalProperties": false,
1222
+ "required": [
1223
+ "type",
1224
+ "flow",
1225
+ "authorizationUrl"
1226
+ ],
1227
+ "properties": {
1228
+ "type": {
1229
+ "type": "string",
1230
+ "enum": [
1231
+ "oauth2"
1232
+ ]
1233
+ },
1234
+ "flow": {
1235
+ "type": "string",
1236
+ "enum": [
1237
+ "implicit"
1238
+ ]
1239
+ },
1240
+ "scopes": {
1241
+ "$ref": "#/definitions/oauth2Scopes"
1242
+ },
1243
+ "authorizationUrl": {
1244
+ "type": "string",
1245
+ "format": "uri"
1246
+ },
1247
+ "description": {
1248
+ "type": "string"
1249
+ }
1250
+ },
1251
+ "patternProperties": {
1252
+ "^x-": {
1253
+ "$ref": "#/definitions/vendorExtension"
1254
+ }
1255
+ }
1256
+ },
1257
+ "oauth2PasswordSecurity": {
1258
+ "type": "object",
1259
+ "additionalProperties": false,
1260
+ "required": [
1261
+ "type",
1262
+ "flow",
1263
+ "tokenUrl"
1264
+ ],
1265
+ "properties": {
1266
+ "type": {
1267
+ "type": "string",
1268
+ "enum": [
1269
+ "oauth2"
1270
+ ]
1271
+ },
1272
+ "flow": {
1273
+ "type": "string",
1274
+ "enum": [
1275
+ "password"
1276
+ ]
1277
+ },
1278
+ "scopes": {
1279
+ "$ref": "#/definitions/oauth2Scopes"
1280
+ },
1281
+ "tokenUrl": {
1282
+ "type": "string",
1283
+ "format": "uri"
1284
+ },
1285
+ "description": {
1286
+ "type": "string"
1287
+ }
1288
+ },
1289
+ "patternProperties": {
1290
+ "^x-": {
1291
+ "$ref": "#/definitions/vendorExtension"
1292
+ }
1293
+ }
1294
+ },
1295
+ "oauth2ApplicationSecurity": {
1296
+ "type": "object",
1297
+ "additionalProperties": false,
1298
+ "required": [
1299
+ "type",
1300
+ "flow",
1301
+ "tokenUrl"
1302
+ ],
1303
+ "properties": {
1304
+ "type": {
1305
+ "type": "string",
1306
+ "enum": [
1307
+ "oauth2"
1308
+ ]
1309
+ },
1310
+ "flow": {
1311
+ "type": "string",
1312
+ "enum": [
1313
+ "application"
1314
+ ]
1315
+ },
1316
+ "scopes": {
1317
+ "$ref": "#/definitions/oauth2Scopes"
1318
+ },
1319
+ "tokenUrl": {
1320
+ "type": "string",
1321
+ "format": "uri"
1322
+ },
1323
+ "description": {
1324
+ "type": "string"
1325
+ }
1326
+ },
1327
+ "patternProperties": {
1328
+ "^x-": {
1329
+ "$ref": "#/definitions/vendorExtension"
1330
+ }
1331
+ }
1332
+ },
1333
+ "oauth2AccessCodeSecurity": {
1334
+ "type": "object",
1335
+ "additionalProperties": false,
1336
+ "required": [
1337
+ "type",
1338
+ "flow",
1339
+ "authorizationUrl",
1340
+ "tokenUrl"
1341
+ ],
1342
+ "properties": {
1343
+ "type": {
1344
+ "type": "string",
1345
+ "enum": [
1346
+ "oauth2"
1347
+ ]
1348
+ },
1349
+ "flow": {
1350
+ "type": "string",
1351
+ "enum": [
1352
+ "accessCode"
1353
+ ]
1354
+ },
1355
+ "scopes": {
1356
+ "$ref": "#/definitions/oauth2Scopes"
1357
+ },
1358
+ "authorizationUrl": {
1359
+ "type": "string",
1360
+ "format": "uri"
1361
+ },
1362
+ "tokenUrl": {
1363
+ "type": "string",
1364
+ "format": "uri"
1365
+ },
1366
+ "description": {
1367
+ "type": "string"
1368
+ }
1369
+ },
1370
+ "patternProperties": {
1371
+ "^x-": {
1372
+ "$ref": "#/definitions/vendorExtension"
1373
+ }
1374
+ }
1375
+ },
1376
+ "oauth2Scopes": {
1377
+ "type": "object",
1378
+ "additionalProperties": {
1379
+ "type": "string"
1380
+ }
1381
+ },
1382
+ "mediaTypeList": {
1383
+ "type": "array",
1384
+ "items": {
1385
+ "$ref": "#/definitions/mimeType"
1386
+ },
1387
+ "uniqueItems": true
1388
+ },
1389
+ "parametersList": {
1390
+ "type": "array",
1391
+ "description": "The parameters needed to send a valid API call.",
1392
+ "additionalItems": false,
1393
+ "items": {
1394
+ "oneOf": [
1395
+ {
1396
+ "$ref": "#/definitions/parameter"
1397
+ },
1398
+ {
1399
+ "$ref": "#/definitions/jsonReference"
1400
+ }
1401
+ ]
1402
+ },
1403
+ "uniqueItems": true
1404
+ },
1405
+ "schemesList": {
1406
+ "type": "array",
1407
+ "description": "The transfer protocol of the API.",
1408
+ "items": {
1409
+ "type": "string",
1410
+ "enum": [
1411
+ "http",
1412
+ "https",
1413
+ "ws",
1414
+ "wss"
1415
+ ]
1416
+ },
1417
+ "uniqueItems": true
1418
+ },
1419
+ "collectionFormat": {
1420
+ "type": "string",
1421
+ "enum": [
1422
+ "csv",
1423
+ "ssv",
1424
+ "tsv",
1425
+ "pipes"
1426
+ ],
1427
+ "default": "csv"
1428
+ },
1429
+ "collectionFormatWithMulti": {
1430
+ "type": "string",
1431
+ "enum": [
1432
+ "csv",
1433
+ "ssv",
1434
+ "tsv",
1435
+ "pipes",
1436
+ "multi"
1437
+ ],
1438
+ "default": "csv"
1439
+ },
1440
+ "title": {
1441
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/title"
1442
+ },
1443
+ "description": {
1444
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/description"
1445
+ },
1446
+ "default": {
1447
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/default"
1448
+ },
1449
+ "multipleOf": {
1450
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/multipleOf"
1451
+ },
1452
+ "maximum": {
1453
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/maximum"
1454
+ },
1455
+ "exclusiveMaximum": {
1456
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"
1457
+ },
1458
+ "minimum": {
1459
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/minimum"
1460
+ },
1461
+ "exclusiveMinimum": {
1462
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"
1463
+ },
1464
+ "maxLength": {
1465
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
1466
+ },
1467
+ "minLength": {
1468
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
1469
+ },
1470
+ "pattern": {
1471
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/pattern"
1472
+ },
1473
+ "maxItems": {
1474
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveInteger"
1475
+ },
1476
+ "minItems": {
1477
+ "$ref": "http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"
1478
+ },
1479
+ "uniqueItems": {
1480
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/uniqueItems"
1481
+ },
1482
+ "enum": {
1483
+ "$ref": "http://json-schema.org/draft-04/schema#/properties/enum"
1484
+ },
1485
+ "jsonReference": {
1486
+ "type": "object",
1487
+ "additionalProperties": false,
1488
+ "properties": {
1489
+ "$ref": {
1490
+ "type": "string"
1491
+ }
1492
+ }
1493
+ }
1494
+ }
1495
+ }