swaggard 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -0
  3. data/app/assets/fonts/swaggard/droid-sans-v6-latin-700.eot +0 -0
  4. data/app/assets/fonts/swaggard/droid-sans-v6-latin-700.svg +0 -0
  5. data/app/assets/fonts/swaggard/droid-sans-v6-latin-700.ttf +0 -0
  6. data/app/assets/fonts/swaggard/droid-sans-v6-latin-700.woff +0 -0
  7. data/app/assets/fonts/swaggard/droid-sans-v6-latin-700.woff2 +0 -0
  8. data/app/assets/fonts/swaggard/droid-sans-v6-latin-regular.eot +0 -0
  9. data/app/assets/fonts/swaggard/droid-sans-v6-latin-regular.svg +0 -0
  10. data/app/assets/fonts/swaggard/droid-sans-v6-latin-regular.ttf +0 -0
  11. data/app/assets/fonts/swaggard/droid-sans-v6-latin-regular.woff +0 -0
  12. data/app/assets/fonts/swaggard/droid-sans-v6-latin-regular.woff2 +0 -0
  13. data/app/assets/images/swaggard/explorer_icons.png +0 -0
  14. data/app/assets/images/swaggard/favicon-16x16.png +0 -0
  15. data/app/assets/images/swaggard/favicon-32x32.png +0 -0
  16. data/app/assets/images/swaggard/favicon.ico +0 -0
  17. data/app/assets/images/swaggard/logo_small.png +0 -0
  18. data/app/assets/images/swaggard/pet_store_api.png +0 -0
  19. data/app/assets/images/swaggard/throbber.gif +0 -0
  20. data/app/assets/images/swaggard/wordnik_api.png +0 -0
  21. data/app/assets/javascripts/swaggard/application.js +12 -12
  22. data/app/assets/javascripts/swaggard/lib/backbone-min.js +0 -0
  23. data/app/assets/javascripts/swaggard/lib/handlebars-2.0.0.js +0 -0
  24. data/app/assets/javascripts/swaggard/lib/highlight.7.3.pack.js +0 -0
  25. data/app/assets/javascripts/swaggard/lib/jquery-1.8.0.min.js +1 -1
  26. data/app/assets/javascripts/swaggard/lib/jquery.ba-bbq.min.js +0 -0
  27. data/app/assets/javascripts/swaggard/lib/jquery.slideto.min.js +0 -0
  28. data/app/assets/javascripts/swaggard/lib/jquery.wiggle.min.js +0 -0
  29. data/app/assets/javascripts/swaggard/lib/marked.js +0 -0
  30. data/app/assets/javascripts/swaggard/lib/swagger-oauth.js +290 -0
  31. data/app/assets/javascripts/swaggard/lib/underscore-min.js +6 -32
  32. data/app/assets/javascripts/swaggard/lib/underscore-min.map +1 -0
  33. data/app/assets/javascripts/swaggard/swaggard.js +59 -0
  34. data/app/assets/javascripts/swaggard/swagger-ui.js +31404 -1363
  35. data/app/assets/stylesheets/swaggard/application.css +1 -1
  36. data/app/assets/stylesheets/swaggard/application_print.css +15 -0
  37. data/app/assets/stylesheets/swaggard/print.css.scss +1175 -0
  38. data/app/assets/stylesheets/swaggard/reset.css +0 -0
  39. data/app/assets/stylesheets/swaggard/screen.css.scss +41 -15
  40. data/app/assets/stylesheets/swaggard/typography.css.scss +2 -1
  41. data/app/controllers/swaggard/swagger_controller.rb +3 -1
  42. data/app/views/swaggard/swagger/index.html.erb +30 -71
  43. data/config/initializers/assets.rb +1 -0
  44. data/lib/swaggard.rb +13 -7
  45. data/lib/swaggard/api_definition.rb +3 -1
  46. data/lib/swaggard/configuration.rb +18 -6
  47. data/lib/swaggard/engine.rb +8 -2
  48. data/lib/swaggard/parsers/controllers.rb +0 -2
  49. data/lib/swaggard/parsers/models.rb +1 -1
  50. data/lib/swaggard/swagger/default_response.rb +17 -0
  51. data/lib/swaggard/swagger/definition.rb +3 -1
  52. data/lib/swaggard/swagger/operation.rb +3 -0
  53. data/lib/swaggard/swagger/parameters/body.rb +4 -2
  54. data/lib/swaggard/swagger/parameters/query.rb +13 -1
  55. data/lib/swaggard/swagger/response.rb +14 -6
  56. data/lib/swaggard/swagger/type.rb +27 -42
  57. data/lib/swaggard/version.rb +1 -1
  58. data/spec/fixtures/api.json +1 -1
  59. data/spec/fixtures/dummy/app/controllers/admin/pets_controller.rb +11 -0
  60. data/spec/fixtures/dummy/config/routes.rb +4 -1
  61. data/spec/fixtures/swagger_schema.json +1495 -0
  62. data/spec/integration/swaggard_spec.rb +8 -4
  63. data/spec/spec_helper.rb +0 -1
  64. metadata +17 -8
  65. data/app/assets/javascripts/swaggard/lib/MD5.js +0 -319
  66. data/app/assets/javascripts/swaggard/lib/handlebars-1.0.rc.1.js +0 -1920
  67. data/app/assets/javascripts/swaggard/lib/shred.bundle.js +0 -2765
  68. data/app/assets/javascripts/swaggard/lib/swagger-client.js +0 -3294
  69. data/app/assets/javascripts/swaggard/lib/swagger.js +0 -794
  70. data/app/assets/javascripts/swaggard/swagger-ui_org.js +0 -2005
@@ -52,11 +52,13 @@ module Swaggard
52
52
  # Example: [Array] status(required) Filter by status. (e.g. status[]=1&status[]=2&status[]=3)
53
53
  # Example: [Integer] media[media_type_id] ID of the desired media type.
54
54
  def parse(string)
55
- data_type, name, required, description = string.match(/\A\[(\w*)\]\s*([\w\[\]]*)(\(required\))?\s*(.*)\Z/).captures
55
+ data_type, name, description = string.split
56
+
57
+ data_type.gsub!('[', '').gsub!(']', '')
56
58
 
57
59
  @id = name
58
60
  @description = description
59
- @type = Type.new([data_type.downcase])
61
+ @type = Type.new([data_type])
60
62
  end
61
63
 
62
64
  end
@@ -10,20 +10,32 @@ module Swaggard
10
10
  parse(string)
11
11
  end
12
12
 
13
+ def to_doc
14
+ doc = super
15
+
16
+ doc.merge!('enum' => @options) if @options.any?
17
+
18
+ doc
19
+ end
20
+
13
21
  private
14
22
 
15
23
  # Example: [Array] status Filter by status. (e.g. status[]=1&status[]=2&status[]=3)
16
24
  # Example: [Array] status(required) Filter by status. (e.g. status[]=1&status[]=2&status[]=3)
17
25
  # Example: [Integer] media[media_type_id] ID of the desired media type.
18
26
  def parse(string)
19
- data_type, name, required, description = string.match(/\A\[(\w*)\]\s*([\w\[\]]*)(\(required\))?\s*(.*)\Z/).captures
27
+ data_type, name, required, options_and_description = string.match(/\A\[(\w*)\]\s*([\w\[\]]*)(\(required\))?\s*(.*)\Z/).captures
20
28
  allow_multiple = name.gsub!('[]', '')
21
29
 
30
+ options, description = options_and_description.match(/\A(\[.*\])?(.*)\Z/).captures
31
+ options = options ? options.gsub(/\[?\]?\s?/, '').split(',') : []
32
+
22
33
  @name = name
23
34
  @description = description
24
35
  @data_type = data_type.downcase
25
36
  @is_required = required.present?
26
37
  @allow_multiple = allow_multiple.present?
38
+ @options = options
27
39
  end
28
40
 
29
41
  end
@@ -2,6 +2,8 @@ module Swaggard
2
2
  module Swagger
3
3
  class Response
4
4
 
5
+ PRIMITIVE_TYPES = %w[number string integer float boolean]
6
+
5
7
  attr_reader :status_code
6
8
 
7
9
  def initialize(status_code, value)
@@ -11,7 +13,8 @@ module Swaggard
11
13
 
12
14
  def to_doc
13
15
  {
14
- 'schema' => response_model
16
+ 'description' => '',
17
+ 'schema' => response_model
15
18
  }
16
19
  end
17
20
 
@@ -29,15 +32,20 @@ module Swaggard
29
32
  def response_model
30
33
  if @is_array_response
31
34
  {
32
- 'type' => 'array',
33
- 'items' => {
34
- '$ref' => "#/definitions/#@response_class"
35
- }
35
+ 'type' => 'array',
36
+ 'items' => response_class_type
36
37
  }
37
38
  else
38
- { '$ref' => "#/definitions/#@response_class" }
39
+ response_class_type
39
40
  end
41
+ end
40
42
 
43
+ def response_class_type
44
+ if PRIMITIVE_TYPES.include?(@response_class)
45
+ { 'type' => @response_class }
46
+ else
47
+ { '$ref' => "#/definitions/#@response_class" }
48
+ end
41
49
  end
42
50
 
43
51
  end
@@ -2,35 +2,37 @@ module Swaggard
2
2
  module Swagger
3
3
  class Type
4
4
 
5
- attr_reader :name
6
-
7
- def self.new(types)
8
- type = super
9
-
10
- all[type.name] = type
11
-
12
- type
13
- end
5
+ BASIC_TYPES = {
6
+ 'integer' => { 'type' => 'integer', 'format' => 'int32' },
7
+ 'long' => { 'type' => 'integer', 'format' => 'int64' },
8
+ 'float' => { 'type' => 'number', 'format' => 'float' },
9
+ 'double' => { 'type' => 'number', 'format' => 'double' },
10
+ 'string' => { 'type' => 'string' },
11
+ 'byte' => { 'type' => 'string', 'format' => 'byte' },
12
+ 'binary' => { 'type' => 'string', 'format' => 'binary' },
13
+ 'boolean' => { 'type' => 'boolean' },
14
+ 'date' => { 'type' => 'string', 'format' => 'date' },
15
+ 'date-time' => { 'type' => 'string', 'format' => 'date-time' },
16
+ 'password' => { 'type' => 'string', 'format' => 'password' },
17
+ 'hash' => { 'type' => 'object' }
18
+ }
14
19
 
15
- def self.all
16
- @all ||= {}
17
- end
20
+ attr_reader :name
18
21
 
19
22
  def initialize(types)
20
23
  parse(types)
21
24
  end
22
25
 
23
26
  def to_doc
24
- doc = if @is_array
25
- { 'type' => 'array' }
26
- else
27
- { type_tag => type_name }
28
- end
29
-
30
-
31
- doc.merge!({ 'items' => { type_tag => type_name } }) if @is_array
27
+ if @is_array
28
+ { 'type' => 'array', 'items' => type_tag_and_name }
29
+ else
30
+ type_tag_and_name
31
+ end
32
+ end
32
33
 
33
- doc
34
+ def basic_type?
35
+ BASIC_TYPES.has_key?(@name.downcase)
34
36
  end
35
37
 
36
38
  private
@@ -42,28 +44,11 @@ module Swaggard
42
44
  @is_array = parts.grep(/array/i).any?
43
45
  end
44
46
 
45
- # TODO: have this look at resource listing?
46
- def ref?
47
- self.class.all[@name].present?
48
- end
49
-
50
- def model_name
51
- ref? ? @name : nil
52
- end
53
-
54
- def type_tag
55
- if ref?
56
- '$ref'
57
- else
58
- 'type'
59
- end
60
- end
61
-
62
- def type_name
63
- if ref?
64
- "#/definitions/#{name}"
47
+ def type_tag_and_name
48
+ if basic_type?
49
+ BASIC_TYPES[@name.downcase]
65
50
  else
66
- name
51
+ { '$ref' => "#/definitions/#{name}" }
67
52
  end
68
53
  end
69
54
 
@@ -1,5 +1,5 @@
1
1
  module Swaggard
2
2
 
3
- VERSION = '0.0.4'
3
+ VERSION = '0.1.0'
4
4
 
5
5
  end
@@ -1 +1 @@
1
- {"swagger":"2.0","info":{"description":"","version":"0.1","title":"","termsOfService":"","contact":{"email":""},"license":{"name":"","url":""}},"host":"","basePath":null,"tags":[{"name":"pets","description":"This document describes the API for interacting with Pet resources"}],"schemes":["http"],"paths":{"/pets":{"get":{"tags":["pets"],"summary":"return a list of Pets","description":"","operationId":"index","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[],"responses":{}}},"/pets/{id}":{"get":{"tags":["pets"],"summary":"return a Pet","description":"","operationId":"show","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[{"in":"query","name":"id","description":"The ID for the Pet","required":false,"type":"integer"},{"in":"path","name":"id","description":"Scope response to id","required":true,"type":"string"}],"responses":{}}}},"definitions":{}}
1
+ {"swagger":"2.0","info":{"description":"","version":"0.1","title":"","termsOfService":"","contact":{"name":"","email":"","url":""},"license":{"name":"","url":""}},"host":"localhost:3000","basePath":"/","tags":[{"name":"admin/pets","description":"This document describes the API for interacting with Pet resources"},{"name":"pets","description":"This document describes the API for interacting with Pet resources"}],"schemes":["http"],"paths":{"/admin/pets":{"get":{"tags":["admin/pets"],"summary":"return a list of Pets","description":"","operationId":"index","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[],"responses":{"default":{"description":"successful operation"}}}},"/pets":{"get":{"tags":["pets"],"summary":"return a list of Pets","description":"","operationId":"index","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[],"responses":{"default":{"description":"successful operation"}}}},"/pets/{id}":{"get":{"tags":["pets"],"summary":"return a Pet","description":"","operationId":"show","consumes":["application/xml","application/json"],"produces":["application/xml","application/json"],"parameters":[{"in":"query","name":"id","description":"The ID for the Pet","required":false,"type":"integer"},{"in":"path","name":"id","description":"Scope response to id","required":true,"type":"string"}],"responses":{"default":{"description":"successful operation"}}}}},"definitions":{}}
@@ -0,0 +1,11 @@
1
+ module Admin
2
+ # This document describes the API for interacting with Pet resources
3
+ class PetsController < ApplicationController
4
+
5
+ # return a list of Pets
6
+ #
7
+ def index
8
+ end
9
+
10
+ end
11
+ end
@@ -2,4 +2,7 @@ Dummy::Application.routes.draw do
2
2
 
3
3
  resources :pets, only: [:index, :show]
4
4
 
5
- end
5
+ namespace :admin do
6
+ resources :pets, only: :index
7
+ end
8
+ end
@@ -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
+ }