grape-swagger 0.20.3 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +10 -10
- data/.travis.yml +8 -3
- data/CHANGELOG.md +27 -0
- data/Gemfile +2 -0
- data/README.md +111 -12
- data/UPGRADING.md +9 -0
- data/grape-swagger.gemspec +1 -3
- data/lib/grape-swagger.rb +8 -1
- data/lib/grape-swagger/doc_methods/optional_object.rb +14 -2
- data/lib/grape-swagger/doc_methods/parse_params.rb +3 -4
- data/lib/grape-swagger/doc_methods/path_string.rb +4 -3
- data/lib/grape-swagger/endpoint.rb +25 -55
- data/lib/grape-swagger/errors.rb +3 -0
- data/lib/grape-swagger/grape/route.rb +2 -1
- data/lib/grape-swagger/model_parsers.rb +33 -0
- data/lib/grape-swagger/version.rb +1 -1
- data/spec/issues/403_versions_spec.rb +20 -4
- data/spec/lib/model_parsers_spec.rb +102 -0
- data/spec/lib/optional_object_spec.rb +15 -11
- data/spec/lib/path_string_spec.rb +72 -18
- data/spec/lib/produces_consumes_spec.rb +10 -5
- data/spec/spec_helper.rb +4 -2
- data/spec/support/empty_model_parser.rb +20 -0
- data/spec/support/mock_parser.rb +22 -0
- data/spec/support/model_parsers/entity_parser.rb +325 -0
- data/spec/support/{api_swagger_v2_result.rb → model_parsers/mock_parser.rb} +186 -60
- data/spec/support/model_parsers/representable_parser.rb +394 -0
- data/spec/support/the_paths_definitions.rb +7 -3
- data/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb +5 -4
- data/spec/swagger_v2/api_swagger_v2_detail_spec.rb +3 -3
- data/spec/swagger_v2/api_swagger_v2_extensions_spec.rb +1 -1
- data/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb +1 -1
- data/spec/swagger_v2/api_swagger_v2_headers_spec.rb +5 -3
- data/spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb +1 -1
- data/spec/swagger_v2/api_swagger_v2_mounted_spec.rb +1 -1
- data/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb +25 -14
- data/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb +22 -12
- data/spec/swagger_v2/api_swagger_v2_param_type_spec.rb +30 -18
- data/spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb +6 -3
- data/spec/swagger_v2/api_swagger_v2_response_spec.rb +13 -40
- data/spec/swagger_v2/api_swagger_v2_spec.rb +4 -2
- data/spec/swagger_v2/api_swagger_v2_type-format_spec.rb +6 -36
- data/spec/swagger_v2/default_api_spec.rb +10 -2
- data/spec/swagger_v2/endpoint_versioned_path_spec.rb +30 -0
- data/spec/swagger_v2/errors_spec.rb +75 -0
- data/spec/swagger_v2/hide_api_spec.rb +22 -4
- data/spec/swagger_v2/mounted_target_class_spec.rb +6 -2
- data/spec/swagger_v2/namespace_tags_prefix_spec.rb +6 -3
- data/spec/swagger_v2/namespace_tags_spec.rb +6 -3
- data/spec/swagger_v2/params_array_spec.rb +4 -2
- data/spec/swagger_v2/params_hash_spec.rb +4 -2
- data/spec/swagger_v2/params_nested_spec.rb +4 -2
- data/spec/swagger_v2/simple_mounted_api_spec.rb +66 -24
- metadata +23 -40
- data/spec/support/the_api_entities.rb +0 -50
- data/spec/swagger_v2/response_model_spec.rb +0 -208
@@ -24,7 +24,7 @@ end
|
|
24
24
|
|
25
25
|
describe 'details' do
|
26
26
|
describe 'take deatils as it is' do
|
27
|
-
include_context
|
27
|
+
include_context "#{MODEL_PARSER} swagger example"
|
28
28
|
|
29
29
|
before :all do
|
30
30
|
module TheApi
|
@@ -74,7 +74,7 @@ describe 'details' do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
describe 'details, convert markdown with kramdown' do
|
77
|
-
include_context
|
77
|
+
include_context "#{MODEL_PARSER} swagger example"
|
78
78
|
|
79
79
|
before :all do
|
80
80
|
module TheApi
|
@@ -112,7 +112,7 @@ describe 'details' do
|
|
112
112
|
end
|
113
113
|
|
114
114
|
describe 'details, convert markdown with redcarpet', unless: RUBY_PLATFORM.eql?('java') do
|
115
|
-
include_context
|
115
|
+
include_context "#{MODEL_PARSER} swagger example"
|
116
116
|
|
117
117
|
before :all do
|
118
118
|
module TheApi
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'headers' do
|
4
|
-
include_context
|
4
|
+
include_context "#{MODEL_PARSER} swagger example"
|
5
5
|
|
6
6
|
before :all do
|
7
7
|
module TheApi
|
@@ -14,7 +14,8 @@ describe 'headers' do
|
|
14
14
|
'X-Rate-Limit-Limit' => {
|
15
15
|
'description' => 'The number of allowed requests in the current period',
|
16
16
|
'type' => 'integer'
|
17
|
-
}
|
17
|
+
}
|
18
|
+
},
|
18
19
|
|
19
20
|
entity: Entities::UseResponse
|
20
21
|
get '/use_headers' do
|
@@ -44,6 +45,7 @@ describe 'headers' do
|
|
44
45
|
'type' => 'integer',
|
45
46
|
'format' => 'int32',
|
46
47
|
'required' => false }
|
47
|
-
]
|
48
|
+
]
|
49
|
+
)
|
48
50
|
end
|
49
51
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do
|
4
|
-
include_context
|
4
|
+
include_context "#{MODEL_PARSER} swagger example"
|
5
5
|
|
6
6
|
before :all do
|
7
7
|
module TheApi
|
@@ -9,7 +9,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
9
9
|
namespace :simple_nested_params do
|
10
10
|
desc 'post in body with nested parameters',
|
11
11
|
detail: 'more details description',
|
12
|
-
success:
|
12
|
+
success: Entities::UseNestedWithAddress
|
13
13
|
params do
|
14
14
|
requires :name, type: String, documentation: { desc: 'name', in: 'body' }
|
15
15
|
optional :address, type: Hash do
|
@@ -26,7 +26,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
26
26
|
|
27
27
|
desc 'put in body with nested parameters',
|
28
28
|
detail: 'more details description',
|
29
|
-
success:
|
29
|
+
success: Entities::UseNestedWithAddress
|
30
30
|
params do
|
31
31
|
requires :id, type: Integer
|
32
32
|
optional :name, type: String, documentation: { desc: 'name', in: 'body' }
|
@@ -45,7 +45,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
45
45
|
|
46
46
|
namespace :multiple_nested_params do
|
47
47
|
desc 'put in body with multiple nested parameters',
|
48
|
-
success:
|
48
|
+
success: Entities::UseNestedWithAddress
|
49
49
|
params do
|
50
50
|
requires :id, type: Integer
|
51
51
|
optional :name, type: String, documentation: { desc: 'name', in: 'body' }
|
@@ -90,7 +90,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
90
90
|
'in' => 'body',
|
91
91
|
'required' => true,
|
92
92
|
'schema' => { '$ref' => '#/definitions/postRequestUseNestedWithAddress' }
|
93
|
-
}]
|
93
|
+
}]
|
94
|
+
)
|
94
95
|
end
|
95
96
|
|
96
97
|
specify do
|
@@ -101,7 +102,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
101
102
|
'address' => { '$ref' => '#/definitions/postRequestUseNestedWithAddressAddress' },
|
102
103
|
'name' => { 'type' => 'string', 'description' => 'name' }
|
103
104
|
},
|
104
|
-
'required' => ['name']
|
105
|
+
'required' => ['name']
|
106
|
+
)
|
105
107
|
expect(subject['definitions']['postRequestUseNestedWithAddressAddress']).to eql(
|
106
108
|
'description' => 'postRequestUseNestedWithAddress - address',
|
107
109
|
'type' => 'object',
|
@@ -111,7 +113,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
111
113
|
'city' => { 'type' => 'string', 'description' => 'city' },
|
112
114
|
'country' => { 'type' => 'string', 'description' => 'country' }
|
113
115
|
},
|
114
|
-
'required' => %w(street postcode city)
|
116
|
+
'required' => %w(street postcode city)
|
117
|
+
)
|
115
118
|
end
|
116
119
|
|
117
120
|
specify do
|
@@ -124,7 +127,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
124
127
|
'required' => true,
|
125
128
|
'schema' => { '$ref' => '#/definitions/putRequestUseNestedWithAddress' }
|
126
129
|
}
|
127
|
-
]
|
130
|
+
]
|
131
|
+
)
|
128
132
|
end
|
129
133
|
|
130
134
|
specify do
|
@@ -135,7 +139,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
135
139
|
'address' => { '$ref' => '#/definitions/putRequestUseNestedWithAddressAddress' },
|
136
140
|
'id' => { 'type' => 'integer', 'format' => 'int32', 'readOnly' => true },
|
137
141
|
'name' => { 'type' => 'string', 'description' => 'name' }
|
138
|
-
}
|
142
|
+
}
|
143
|
+
)
|
139
144
|
expect(subject['definitions']['putRequestUseNestedWithAddressAddress']).to eql(
|
140
145
|
'description' => 'putRequestUseNestedWithAddress - address',
|
141
146
|
'type' => 'object',
|
@@ -143,7 +148,9 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
143
148
|
'street' => { 'type' => 'string', 'description' => 'street' },
|
144
149
|
'postcode' => { 'type' => 'string', 'description' => 'postcode' },
|
145
150
|
'city' => { 'type' => 'string', 'description' => 'city' },
|
146
|
-
'country' => { 'type' => 'string', 'description' => 'country' }
|
151
|
+
'country' => { 'type' => 'string', 'description' => 'country' }
|
152
|
+
}
|
153
|
+
)
|
147
154
|
end
|
148
155
|
end
|
149
156
|
|
@@ -158,7 +165,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
158
165
|
[
|
159
166
|
{ 'in' => 'path', 'name' => 'id', 'type' => 'integer', 'format' => 'int32', 'required' => true },
|
160
167
|
{ 'name' => 'UseNestedWithAddress', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putRequestUseNestedWithAddress' } }
|
161
|
-
]
|
168
|
+
]
|
169
|
+
)
|
162
170
|
end
|
163
171
|
|
164
172
|
specify do
|
@@ -170,7 +178,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
170
178
|
'delivery_address' => { '$ref' => '#/definitions/putRequestUseNestedWithAddressDeliveryAddress' },
|
171
179
|
'id' => { 'type' => 'integer', 'format' => 'int32', 'readOnly' => true },
|
172
180
|
'name' => { 'type' => 'string', 'description' => 'name' }
|
173
|
-
}
|
181
|
+
}
|
182
|
+
)
|
174
183
|
expect(subject['definitions']['putRequestUseNestedWithAddressAddress']).to eql(
|
175
184
|
'description' => 'putRequestUseNestedWithAddress - address',
|
176
185
|
'type' => 'object',
|
@@ -180,7 +189,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
180
189
|
'city' => { 'type' => 'string', 'description' => 'city' },
|
181
190
|
'country' => { 'type' => 'string', 'description' => 'country' }
|
182
191
|
},
|
183
|
-
'required' => ['postcode']
|
192
|
+
'required' => ['postcode']
|
193
|
+
)
|
184
194
|
expect(subject['definitions']['putRequestUseNestedWithAddressDeliveryAddress']).to eql(
|
185
195
|
'description' => 'putRequestUseNestedWithAddress - delivery_address',
|
186
196
|
'type' => 'object',
|
@@ -189,7 +199,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
189
199
|
'postcode' => { 'type' => 'string', 'description' => 'postcode' },
|
190
200
|
'city' => { 'type' => 'string', 'description' => 'city' },
|
191
201
|
'country' => { 'type' => 'string', 'description' => 'country' }
|
192
|
-
}
|
202
|
+
}
|
203
|
+
)
|
193
204
|
end
|
194
205
|
end
|
195
206
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do
|
4
|
-
include_context
|
4
|
+
include_context "#{MODEL_PARSER} swagger example"
|
5
5
|
|
6
6
|
before :all do
|
7
7
|
module TheApi
|
@@ -33,7 +33,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
33
33
|
|
34
34
|
namespace :with_entities do
|
35
35
|
desc 'post in body with entity',
|
36
|
-
success:
|
36
|
+
success: ::Entities::ResponseItem
|
37
37
|
params do
|
38
38
|
requires :name, type: String, documentation: { desc: 'name', param_type: 'body' }
|
39
39
|
end
|
@@ -43,7 +43,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
43
43
|
end
|
44
44
|
|
45
45
|
desc 'put in body with entity',
|
46
|
-
success:
|
46
|
+
success: ::Entities::ResponseItem
|
47
47
|
params do
|
48
48
|
requires :id, type: Integer
|
49
49
|
optional :name, type: String, documentation: { desc: 'name', param_type: 'body' }
|
@@ -73,7 +73,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
73
73
|
expect(subject['paths']['/wo_entities/in_body']['post']['parameters']).to eql(
|
74
74
|
[
|
75
75
|
{ 'name' => 'postWoEntitiesInBody', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postWoEntitiesInBody' } }
|
76
|
-
]
|
76
|
+
]
|
77
|
+
)
|
77
78
|
end
|
78
79
|
|
79
80
|
specify do
|
@@ -85,7 +86,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
85
86
|
'in_body_2' => { 'type' => 'string', 'description' => 'in_body_2' },
|
86
87
|
'in_body_3' => { 'type' => 'string', 'description' => 'in_body_3' }
|
87
88
|
},
|
88
|
-
'required' => ['in_body_1']
|
89
|
+
'required' => ['in_body_1']
|
90
|
+
)
|
89
91
|
end
|
90
92
|
|
91
93
|
specify do
|
@@ -93,7 +95,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
93
95
|
[
|
94
96
|
{ 'in' => 'path', 'name' => 'key', 'type' => 'integer', 'format' => 'int32', 'required' => true },
|
95
97
|
{ 'name' => 'putWoEntitiesInBodyKey', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putWoEntitiesInBodyKey' } }
|
96
|
-
]
|
98
|
+
]
|
99
|
+
)
|
97
100
|
end
|
98
101
|
|
99
102
|
specify do
|
@@ -105,7 +108,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
105
108
|
'in_body_1' => { 'type' => 'integer', 'format' => 'int32', 'description' => 'in_body_1' },
|
106
109
|
'in_body_2' => { 'type' => 'string', 'description' => 'in_body_2' },
|
107
110
|
'in_body_3' => { 'type' => 'string', 'description' => 'in_body_3' }
|
108
|
-
}
|
111
|
+
}
|
112
|
+
)
|
109
113
|
end
|
110
114
|
end
|
111
115
|
|
@@ -119,7 +123,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
119
123
|
expect(subject['paths']['/with_entities/in_body']['post']['parameters']).to eql(
|
120
124
|
[
|
121
125
|
{ 'name' => 'ResponseItem', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/postRequestResponseItem' } }
|
122
|
-
]
|
126
|
+
]
|
127
|
+
)
|
123
128
|
end
|
124
129
|
|
125
130
|
specify do
|
@@ -127,8 +132,10 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
127
132
|
'description' => 'post in body with entity',
|
128
133
|
'type' => 'object',
|
129
134
|
'properties' => {
|
130
|
-
'name' => { 'type' => 'string', 'description' => 'name' }
|
131
|
-
|
135
|
+
'name' => { 'type' => 'string', 'description' => 'name' }
|
136
|
+
},
|
137
|
+
'required' => ['name']
|
138
|
+
)
|
132
139
|
end
|
133
140
|
|
134
141
|
specify do
|
@@ -136,7 +143,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
136
143
|
[
|
137
144
|
{ 'in' => 'path', 'name' => 'id', 'type' => 'integer', 'format' => 'int32', 'required' => true },
|
138
145
|
{ 'name' => 'ResponseItem', 'in' => 'body', 'required' => true, 'schema' => { '$ref' => '#/definitions/putRequestResponseItem' } }
|
139
|
-
]
|
146
|
+
]
|
147
|
+
)
|
140
148
|
end
|
141
149
|
|
142
150
|
specify do
|
@@ -145,7 +153,9 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
145
153
|
'type' => 'object',
|
146
154
|
'properties' => {
|
147
155
|
'id' => { 'type' => 'integer', 'format' => 'int32', 'readOnly' => true },
|
148
|
-
'name' => { 'type' => 'string', 'description' => 'name' }
|
156
|
+
'name' => { 'type' => 'string', 'description' => 'name' }
|
157
|
+
}
|
158
|
+
)
|
149
159
|
end
|
150
160
|
end
|
151
161
|
end
|
@@ -1,14 +1,14 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `header`' do
|
4
|
-
include_context
|
4
|
+
include_context "#{MODEL_PARSER} swagger example"
|
5
5
|
|
6
6
|
before :all do
|
7
7
|
module TheApi
|
8
8
|
class ParamTypeApi < Grape::API
|
9
9
|
# using `:param_type`
|
10
10
|
desc 'full set of request param types',
|
11
|
-
success:
|
11
|
+
success: Entities::UseResponse
|
12
12
|
params do
|
13
13
|
optional :in_query, type: String, documentation: { param_type: 'query' }
|
14
14
|
optional :in_header, type: String, documentation: { param_type: 'header' }
|
@@ -19,7 +19,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
19
19
|
end
|
20
20
|
|
21
21
|
desc 'full set of request param types',
|
22
|
-
success:
|
22
|
+
success: Entities::UseResponse
|
23
23
|
params do
|
24
24
|
requires :in_path, type: Integer
|
25
25
|
optional :in_query, type: String, documentation: { param_type: 'query' }
|
@@ -31,7 +31,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
31
31
|
end
|
32
32
|
|
33
33
|
desc 'full set of request param types',
|
34
|
-
success:
|
34
|
+
success: Entities::UseResponse
|
35
35
|
params do
|
36
36
|
optional :in_path, type: Integer
|
37
37
|
optional :in_query, type: String, documentation: { param_type: 'query' }
|
@@ -44,7 +44,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
44
44
|
|
45
45
|
# using `:in`
|
46
46
|
desc 'full set of request param types using `:in`',
|
47
|
-
success:
|
47
|
+
success: Entities::UseResponse
|
48
48
|
params do
|
49
49
|
optional :in_query, type: String, documentation: { in: 'query' }
|
50
50
|
optional :in_header, type: String, documentation: { in: 'header' }
|
@@ -55,7 +55,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
55
55
|
end
|
56
56
|
|
57
57
|
desc 'full set of request param types using `:in`',
|
58
|
-
success:
|
58
|
+
success: Entities::UseResponse
|
59
59
|
params do
|
60
60
|
requires :in_path, type: Integer
|
61
61
|
optional :in_query, type: String, documentation: { in: 'query' }
|
@@ -79,7 +79,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
79
79
|
|
80
80
|
# file
|
81
81
|
desc 'file download',
|
82
|
-
success:
|
82
|
+
success: Entities::UseResponse
|
83
83
|
params do
|
84
84
|
requires :name, type: String
|
85
85
|
end
|
@@ -89,7 +89,7 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
89
89
|
end
|
90
90
|
|
91
91
|
desc 'file upload',
|
92
|
-
success:
|
92
|
+
success: Entities::UseResponse
|
93
93
|
params do
|
94
94
|
requires :name, type: File
|
95
95
|
end
|
@@ -117,13 +117,17 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
117
117
|
expect(subject['paths']['/defined_param_type/{in_path}']['delete']['responses']).to eql(
|
118
118
|
'200' => {
|
119
119
|
'description' => 'full set of request param types',
|
120
|
-
'schema' => { '$ref' => '#/definitions/UseResponse' }
|
120
|
+
'schema' => { '$ref' => '#/definitions/UseResponse' }
|
121
|
+
}
|
122
|
+
)
|
121
123
|
end
|
122
124
|
|
123
125
|
specify do
|
124
126
|
expect(subject['paths']['/defined_in/{in_path}']['delete']['responses']).to eql(
|
125
127
|
'204' => {
|
126
|
-
'description' => 'full set of request param types using `:in`'
|
128
|
+
'description' => 'full set of request param types using `:in`'
|
129
|
+
}
|
130
|
+
)
|
127
131
|
end
|
128
132
|
end
|
129
133
|
|
@@ -138,7 +142,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
138
142
|
[
|
139
143
|
{ 'in' => 'query', 'name' => 'in_query', 'required' => false, 'type' => 'string' },
|
140
144
|
{ 'in' => 'header', 'name' => 'in_header', 'required' => false, 'type' => 'string' }
|
141
|
-
]
|
145
|
+
]
|
146
|
+
)
|
142
147
|
end
|
143
148
|
|
144
149
|
specify do
|
@@ -147,7 +152,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
147
152
|
{ 'in' => 'path', 'name' => 'in_path', 'required' => true, 'type' => 'integer', 'format' => 'int32' },
|
148
153
|
{ 'in' => 'query', 'name' => 'in_query', 'required' => false, 'type' => 'string' },
|
149
154
|
{ 'in' => 'header', 'name' => 'in_header', 'required' => false, 'type' => 'string' }
|
150
|
-
]
|
155
|
+
]
|
156
|
+
)
|
151
157
|
end
|
152
158
|
|
153
159
|
specify do
|
@@ -156,7 +162,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
156
162
|
{ 'in' => 'path', 'name' => 'in_path', 'required' => true, 'type' => 'integer', 'format' => 'int32' },
|
157
163
|
{ 'in' => 'query', 'name' => 'in_query', 'required' => false, 'type' => 'string' },
|
158
164
|
{ 'in' => 'header', 'name' => 'in_header', 'required' => false, 'type' => 'string' }
|
159
|
-
]
|
165
|
+
]
|
166
|
+
)
|
160
167
|
end
|
161
168
|
end
|
162
169
|
|
@@ -171,7 +178,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
171
178
|
[
|
172
179
|
{ 'in' => 'query', 'name' => 'in_query', 'required' => false, 'type' => 'string' },
|
173
180
|
{ 'in' => 'header', 'name' => 'in_header', 'required' => false, 'type' => 'string' }
|
174
|
-
]
|
181
|
+
]
|
182
|
+
)
|
175
183
|
end
|
176
184
|
|
177
185
|
specify do
|
@@ -180,7 +188,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
180
188
|
{ 'in' => 'path', 'name' => 'in_path', 'required' => true, 'type' => 'integer', 'format' => 'int32' },
|
181
189
|
{ 'in' => 'query', 'name' => 'in_query', 'required' => false, 'type' => 'string' },
|
182
190
|
{ 'in' => 'header', 'name' => 'in_header', 'required' => false, 'type' => 'string' }
|
183
|
-
]
|
191
|
+
]
|
192
|
+
)
|
184
193
|
end
|
185
194
|
|
186
195
|
specify do
|
@@ -189,7 +198,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
189
198
|
{ 'in' => 'path', 'name' => 'in_path', 'required' => true, 'type' => 'integer', 'format' => 'int32' },
|
190
199
|
{ 'in' => 'query', 'name' => 'in_query', 'required' => false, 'type' => 'string' },
|
191
200
|
{ 'in' => 'header', 'name' => 'in_header', 'required' => false, 'type' => 'string' }
|
192
|
-
]
|
201
|
+
]
|
202
|
+
)
|
193
203
|
end
|
194
204
|
end
|
195
205
|
|
@@ -204,7 +214,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
204
214
|
expect(subject['paths']['/upload']['post']['parameters']).to eql(
|
205
215
|
[
|
206
216
|
{ 'in' => 'formData', 'name' => 'name', 'required' => true, 'type' => 'file' }
|
207
|
-
]
|
217
|
+
]
|
218
|
+
)
|
208
219
|
end
|
209
220
|
end
|
210
221
|
|
@@ -218,7 +229,8 @@ describe 'setting of param type, such as `query`, `path`, `formData`, `body`, `h
|
|
218
229
|
expect(subject['paths']['/download']['get']['parameters']).to eql(
|
219
230
|
[
|
220
231
|
{ 'in' => 'query', 'name' => 'name', 'required' => true, 'type' => 'string' }
|
221
|
-
]
|
232
|
+
]
|
233
|
+
)
|
222
234
|
end
|
223
235
|
end
|
224
236
|
end
|