grape-swagger 0.21.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +1 -1
- data/CHANGELOG.md +24 -2
- data/Gemfile +5 -0
- data/README.md +105 -3
- data/example/api/endpoints.rb +16 -16
- data/lib/grape-swagger.rb +0 -1
- data/lib/grape-swagger/doc_methods.rb +1 -0
- data/lib/grape-swagger/doc_methods/data_type.rb +15 -3
- data/lib/grape-swagger/doc_methods/extensions.rb +16 -12
- data/lib/grape-swagger/doc_methods/move_params.rb +139 -94
- data/lib/grape-swagger/doc_methods/parse_params.rb +9 -7
- data/lib/grape-swagger/endpoint.rb +36 -17
- data/lib/grape-swagger/version.rb +1 -1
- data/spec/lib/data_type_spec.rb +24 -0
- data/spec/lib/endpoint_spec.rb +13 -0
- data/spec/lib/move_params_spec.rb +124 -116
- data/spec/support/model_parsers/entity_parser.rb +8 -2
- data/spec/support/model_parsers/mock_parser.rb +10 -0
- data/spec/support/model_parsers/representable_parser.rb +7 -0
- data/spec/support/the_paths_definitions.rb +1 -2
- data/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb +2 -1
- data/spec/swagger_v2/api_swagger_v2_detail_spec.rb +1 -1
- data/spec/swagger_v2/api_swagger_v2_extensions_spec.rb +22 -1
- data/spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb +4 -1
- data/spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb +60 -0
- data/spec/swagger_v2/api_swagger_v2_headers_spec.rb +14 -9
- data/spec/swagger_v2/api_swagger_v2_hide_param_spec.rb +90 -0
- data/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb +185 -110
- data/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb +11 -13
- data/spec/swagger_v2/api_swagger_v2_response_spec.rb +5 -5
- data/spec/swagger_v2/endpoint_versioned_path_spec.rb +19 -18
- data/spec/swagger_v2/namespaced_api_spec.rb +20 -0
- data/spec/swagger_v2/param_multi_type_spec.rb +73 -0
- data/spec/swagger_v2/param_type_spec.rb +54 -27
- data/spec/swagger_v2/params_array_spec.rb +96 -6
- data/spec/swagger_v2/params_nested_spec.rb +2 -2
- metadata +9 -3
@@ -42,8 +42,8 @@ describe 'nested group params' do
|
|
42
42
|
specify do
|
43
43
|
expect(subject['paths']['/nested_array']['post']['parameters']).to eql(
|
44
44
|
[
|
45
|
-
{ 'in' => 'formData', 'name' => 'a_array[
|
46
|
-
{ 'in' => 'formData', 'name' => 'a_array[
|
45
|
+
{ 'in' => 'formData', 'name' => 'a_array[param_1]', 'required' => true, 'type' => 'array', 'items' => { 'type' => 'integer', 'format' => 'int32' } },
|
46
|
+
{ 'in' => 'formData', 'name' => 'a_array[b_array][param_2]', 'required' => true, 'type' => 'array', 'items' => { 'type' => 'string' } }
|
47
47
|
]
|
48
48
|
)
|
49
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-swagger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Vandecasteele
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|
@@ -281,8 +281,10 @@ files:
|
|
281
281
|
- spec/swagger_v2/api_swagger_v2_extensions_spec.rb
|
282
282
|
- spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb
|
283
283
|
- spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb
|
284
|
+
- spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb
|
284
285
|
- spec/swagger_v2/api_swagger_v2_headers_spec.rb
|
285
286
|
- spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb
|
287
|
+
- spec/swagger_v2/api_swagger_v2_hide_param_spec.rb
|
286
288
|
- spec/swagger_v2/api_swagger_v2_mounted_spec.rb
|
287
289
|
- spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb
|
288
290
|
- spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb
|
@@ -305,6 +307,7 @@ files:
|
|
305
307
|
- spec/swagger_v2/namespace_tags_prefix_spec.rb
|
306
308
|
- spec/swagger_v2/namespace_tags_spec.rb
|
307
309
|
- spec/swagger_v2/namespaced_api_spec.rb
|
310
|
+
- spec/swagger_v2/param_multi_type_spec.rb
|
308
311
|
- spec/swagger_v2/param_type_spec.rb
|
309
312
|
- spec/swagger_v2/param_values_spec.rb
|
310
313
|
- spec/swagger_v2/params_array_spec.rb
|
@@ -333,7 +336,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
333
336
|
version: '0'
|
334
337
|
requirements: []
|
335
338
|
rubyforge_project:
|
336
|
-
rubygems_version: 2.
|
339
|
+
rubygems_version: 2.6.4
|
337
340
|
signing_key:
|
338
341
|
specification_version: 4
|
339
342
|
summary: A simple way to add auto generated documentation to your Grape API that can
|
@@ -365,8 +368,10 @@ test_files:
|
|
365
368
|
- spec/swagger_v2/api_swagger_v2_extensions_spec.rb
|
366
369
|
- spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb
|
367
370
|
- spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb
|
371
|
+
- spec/swagger_v2/api_swagger_v2_hash_and_array_spec.rb
|
368
372
|
- spec/swagger_v2/api_swagger_v2_headers_spec.rb
|
369
373
|
- spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb
|
374
|
+
- spec/swagger_v2/api_swagger_v2_hide_param_spec.rb
|
370
375
|
- spec/swagger_v2/api_swagger_v2_mounted_spec.rb
|
371
376
|
- spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb
|
372
377
|
- spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb
|
@@ -389,6 +394,7 @@ test_files:
|
|
389
394
|
- spec/swagger_v2/namespace_tags_prefix_spec.rb
|
390
395
|
- spec/swagger_v2/namespace_tags_spec.rb
|
391
396
|
- spec/swagger_v2/namespaced_api_spec.rb
|
397
|
+
- spec/swagger_v2/param_multi_type_spec.rb
|
392
398
|
- spec/swagger_v2/param_type_spec.rb
|
393
399
|
- spec/swagger_v2/param_values_spec.rb
|
394
400
|
- spec/swagger_v2/params_array_spec.rb
|