grape-swagger 0.20.2 → 0.20.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -3
- data/.rubocop_todo.yml +43 -33
- data/.travis.yml +22 -13
- data/CHANGELOG.md +29 -53
- data/Gemfile +1 -1
- data/README.md +24 -24
- data/example/api/endpoints.rb +28 -29
- data/example/api/entities.rb +1 -1
- data/example/config.ru +5 -7
- data/grape-swagger.gemspec +1 -1
- data/lib/grape-swagger.rb +9 -6
- data/lib/grape-swagger/doc_methods.rb +1 -1
- data/lib/grape-swagger/doc_methods/extensions.rb +3 -3
- data/lib/grape-swagger/doc_methods/headers.rb +1 -1
- data/lib/grape-swagger/doc_methods/move_params.rb +25 -16
- data/lib/grape-swagger/doc_methods/operation_id.rb +2 -2
- data/lib/grape-swagger/doc_methods/parse_params.rb +12 -5
- data/lib/grape-swagger/doc_methods/path_string.rb +1 -1
- data/lib/grape-swagger/doc_methods/status_codes.rb +3 -1
- data/lib/grape-swagger/doc_methods/tag_name_description.rb +1 -1
- data/lib/grape-swagger/endpoint.rb +33 -46
- data/lib/grape-swagger/grape/route.rb +16 -0
- data/lib/grape-swagger/version.rb +1 -1
- data/spec/issues/403_versions_spec.rb +158 -0
- data/spec/lib/data_type_spec.rb +9 -10
- data/spec/lib/endpoint_spec.rb +1 -2
- data/spec/lib/extensions_spec.rb +44 -40
- data/spec/lib/move_params_spec.rb +113 -93
- data/spec/lib/operation_id_spec.rb +42 -12
- data/spec/lib/optional_object_spec.rb +3 -4
- data/spec/lib/path_string_spec.rb +2 -2
- data/spec/lib/produces_consumes_spec.rb +64 -53
- data/spec/markdown/redcarpet_adapter_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/support/api_swagger_v2_result.rb +122 -128
- data/spec/support/namespace_tags.rb +17 -19
- data/spec/support/the_api_entities.rb +1 -3
- data/spec/support/the_paths_definitions.rb +95 -85
- data/spec/swagger_v2/api_swagger_v2_definitions-models_spec.rb +1 -1
- data/spec/swagger_v2/api_swagger_v2_detail_spec.rb +19 -19
- data/spec/swagger_v2/api_swagger_v2_extensions_spec.rb +21 -21
- data/spec/swagger_v2/api_swagger_v2_format-content_type_spec.rb +34 -32
- data/spec/swagger_v2/api_swagger_v2_global_configuration_spec.rb +5 -7
- data/spec/swagger_v2/api_swagger_v2_headers_spec.rb +19 -18
- data/spec/swagger_v2/api_swagger_v2_hide_documentation_path_spec.rb +9 -10
- data/spec/swagger_v2/api_swagger_v2_mounted_spec.rb +21 -24
- data/spec/swagger_v2/api_swagger_v2_param_type_body_nested_spec.rb +90 -92
- data/spec/swagger_v2/api_swagger_v2_param_type_body_spec.rb +54 -54
- data/spec/swagger_v2/api_swagger_v2_param_type_spec.rb +65 -57
- data/spec/swagger_v2/api_swagger_v2_request_params_fix_spec.rb +17 -14
- data/spec/swagger_v2/api_swagger_v2_response_spec.rb +79 -123
- data/spec/swagger_v2/api_swagger_v2_spec.rb +33 -34
- data/spec/swagger_v2/api_swagger_v2_type-format_spec.rb +32 -36
- data/spec/swagger_v2/boolean_params_spec.rb +1 -1
- data/spec/swagger_v2/default_api_spec.rb +26 -29
- data/spec/swagger_v2/description_not_initialized.rb +3 -3
- data/spec/swagger_v2/float_api_spec.rb +1 -1
- data/spec/swagger_v2/form_params_spec.rb +4 -4
- data/spec/swagger_v2/hide_api_spec.rb +48 -51
- data/spec/swagger_v2/host.rb +1 -1
- data/spec/swagger_v2/mounted_target_class_spec.rb +31 -33
- data/spec/swagger_v2/namespace_tags_prefix_spec.rb +23 -21
- data/spec/swagger_v2/namespace_tags_spec.rb +23 -20
- data/spec/swagger_v2/param_type_spec.rb +5 -6
- data/spec/swagger_v2/param_values_spec.rb +31 -37
- data/spec/swagger_v2/params_array_spec.rb +17 -15
- data/spec/swagger_v2/params_hash_spec.rb +17 -15
- data/spec/swagger_v2/params_nested_spec.rb +12 -10
- data/spec/swagger_v2/reference_entity.rb +9 -9
- data/spec/swagger_v2/response_model_spec.rb +58 -62
- data/spec/swagger_v2/simple_mounted_api_spec.rb +179 -147
- metadata +5 -10
- data/spec/params_entity_spec.rb +0 -49
data/spec/params_entity_spec.rb
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe 'Array Params' do
|
4
|
-
before do
|
5
|
-
module Entities
|
6
|
-
class Item < Grape::Entity
|
7
|
-
expose :content, documentation: { type: String }
|
8
|
-
end
|
9
|
-
|
10
|
-
class Set < Grape::Entity
|
11
|
-
expose :items, using: Entities::Item, documentation: { type: Set, is_array: true }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def app
|
17
|
-
Class.new(Grape::API) do
|
18
|
-
format :json
|
19
|
-
|
20
|
-
params do
|
21
|
-
requires :a_array, type: Entities::Set
|
22
|
-
end
|
23
|
-
post :splines do
|
24
|
-
end
|
25
|
-
|
26
|
-
params do
|
27
|
-
optional :raw_array, type: Array
|
28
|
-
end
|
29
|
-
get :raw_array_splines do
|
30
|
-
end
|
31
|
-
|
32
|
-
params do
|
33
|
-
optional :raw_array, type: Array[Integer]
|
34
|
-
end
|
35
|
-
get :raw_array_integers do
|
36
|
-
end
|
37
|
-
|
38
|
-
add_swagger_documentation
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
before do
|
43
|
-
get '/swagger_doc/splines'
|
44
|
-
end
|
45
|
-
|
46
|
-
let(:response) { JSON.parse(last_response.body) }
|
47
|
-
specify do
|
48
|
-
end
|
49
|
-
end
|