grape 1.3.3 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +111 -2
- data/CONTRIBUTING.md +2 -1
- data/README.md +135 -23
- data/UPGRADING.md +237 -46
- data/grape.gemspec +5 -5
- data/lib/grape/api/instance.rb +34 -42
- data/lib/grape/api.rb +21 -16
- data/lib/grape/cookies.rb +2 -0
- data/lib/grape/dsl/callbacks.rb +1 -1
- data/lib/grape/dsl/desc.rb +3 -5
- data/lib/grape/dsl/headers.rb +5 -2
- data/lib/grape/dsl/helpers.rb +8 -5
- data/lib/grape/dsl/inside_route.rb +72 -53
- data/lib/grape/dsl/middleware.rb +4 -4
- data/lib/grape/dsl/parameters.rb +11 -7
- data/lib/grape/dsl/request_response.rb +9 -6
- data/lib/grape/dsl/routing.rb +8 -9
- data/lib/grape/dsl/settings.rb +5 -5
- data/lib/grape/dsl/validations.rb +18 -1
- data/lib/grape/eager_load.rb +1 -1
- data/lib/grape/endpoint.rb +29 -42
- data/lib/grape/error_formatter/json.rb +2 -6
- data/lib/grape/error_formatter/xml.rb +2 -6
- data/lib/grape/exceptions/empty_message_body.rb +11 -0
- data/lib/grape/exceptions/validation.rb +2 -3
- data/lib/grape/exceptions/validation_errors.rb +1 -1
- data/lib/grape/formatter/json.rb +1 -0
- data/lib/grape/formatter/serializable_hash.rb +2 -1
- data/lib/grape/formatter/xml.rb +1 -0
- data/lib/grape/locale/en.yml +1 -1
- data/lib/grape/middleware/auth/base.rb +3 -3
- data/lib/grape/middleware/auth/dsl.rb +7 -1
- data/lib/grape/middleware/base.rb +6 -3
- data/lib/grape/middleware/error.rb +11 -13
- data/lib/grape/middleware/formatter.rb +7 -7
- data/lib/grape/middleware/stack.rb +10 -3
- data/lib/grape/middleware/versioner/accept_version_header.rb +3 -5
- data/lib/grape/middleware/versioner/header.rb +6 -4
- data/lib/grape/middleware/versioner/param.rb +1 -0
- data/lib/grape/middleware/versioner/parse_media_type_patch.rb +2 -1
- data/lib/grape/middleware/versioner/path.rb +2 -0
- data/lib/grape/parser/json.rb +1 -1
- data/lib/grape/parser/xml.rb +1 -1
- data/lib/grape/path.rb +1 -0
- data/lib/grape/request.rb +4 -1
- data/lib/grape/router/attribute_translator.rb +3 -3
- data/lib/grape/router/pattern.rb +1 -1
- data/lib/grape/router/route.rb +2 -2
- data/lib/grape/router.rb +31 -30
- data/lib/grape/{serve_file → serve_stream}/file_body.rb +1 -1
- data/lib/grape/{serve_file → serve_stream}/sendfile_response.rb +1 -1
- data/lib/grape/{serve_file/file_response.rb → serve_stream/stream_response.rb} +8 -8
- data/lib/grape/util/base_inheritable.rb +2 -2
- data/lib/grape/util/inheritable_setting.rb +1 -3
- data/lib/grape/util/lazy_value.rb +4 -2
- data/lib/grape/util/strict_hash_configuration.rb +1 -1
- data/lib/grape/validations/attributes_iterator.rb +8 -0
- data/lib/grape/validations/multiple_attributes_iterator.rb +1 -1
- data/lib/grape/validations/params_scope.rb +97 -62
- data/lib/grape/validations/single_attribute_iterator.rb +1 -1
- data/lib/grape/validations/types/custom_type_coercer.rb +16 -3
- data/lib/grape/validations/types/dry_type_coercer.rb +1 -1
- data/lib/grape/validations/types/invalid_value.rb +24 -0
- data/lib/grape/validations/types/json.rb +2 -1
- data/lib/grape/validations/types/primitive_coercer.rb +4 -5
- data/lib/grape/validations/types.rb +1 -4
- data/lib/grape/validations/validator_factory.rb +1 -1
- data/lib/grape/validations/validators/all_or_none.rb +8 -5
- data/lib/grape/validations/validators/allow_blank.rb +9 -7
- data/lib/grape/validations/validators/as.rb +6 -8
- data/lib/grape/validations/validators/at_least_one_of.rb +7 -4
- data/lib/grape/validations/validators/base.rb +74 -69
- data/lib/grape/validations/validators/coerce.rb +63 -76
- data/lib/grape/validations/validators/default.rb +36 -34
- data/lib/grape/validations/validators/exactly_one_of.rb +9 -6
- data/lib/grape/validations/validators/except_values.rb +13 -11
- data/lib/grape/validations/validators/multiple_params_base.rb +24 -19
- data/lib/grape/validations/validators/mutual_exclusion.rb +8 -5
- data/lib/grape/validations/validators/presence.rb +7 -4
- data/lib/grape/validations/validators/regexp.rb +8 -5
- data/lib/grape/validations/validators/same_as.rb +18 -15
- data/lib/grape/validations/validators/values.rb +61 -56
- data/lib/grape/validations.rb +6 -0
- data/lib/grape/version.rb +1 -1
- data/lib/grape.rb +7 -3
- data/spec/grape/api/custom_validations_spec.rb +77 -45
- data/spec/grape/api/deeply_included_options_spec.rb +3 -3
- data/spec/grape/api/defines_boolean_in_params_spec.rb +2 -1
- data/spec/grape/api/invalid_format_spec.rb +2 -0
- data/spec/grape/api/recognize_path_spec.rb +1 -1
- data/spec/grape/api/routes_with_requirements_spec.rb +8 -8
- data/spec/grape/api/shared_helpers_exactly_one_of_spec.rb +9 -15
- data/spec/grape/api_remount_spec.rb +25 -19
- data/spec/grape/api_spec.rb +576 -211
- data/spec/grape/dsl/callbacks_spec.rb +2 -1
- data/spec/grape/dsl/headers_spec.rb +39 -9
- data/spec/grape/dsl/helpers_spec.rb +3 -2
- data/spec/grape/dsl/inside_route_spec.rb +185 -34
- data/spec/grape/dsl/logger_spec.rb +16 -18
- data/spec/grape/dsl/middleware_spec.rb +2 -1
- data/spec/grape/dsl/parameters_spec.rb +2 -0
- data/spec/grape/dsl/request_response_spec.rb +1 -0
- data/spec/grape/dsl/routing_spec.rb +10 -7
- data/spec/grape/endpoint/declared_spec.rb +848 -0
- data/spec/grape/endpoint_spec.rb +77 -589
- data/spec/grape/entity_spec.rb +29 -23
- data/spec/grape/exceptions/body_parse_errors_spec.rb +3 -0
- data/spec/grape/exceptions/invalid_accept_header_spec.rb +61 -22
- data/spec/grape/exceptions/validation_errors_spec.rb +13 -10
- data/spec/grape/exceptions/validation_spec.rb +5 -3
- data/spec/grape/extensions/param_builders/hash_spec.rb +7 -7
- data/spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb +8 -8
- data/spec/grape/extensions/param_builders/hashie/mash_spec.rb +8 -8
- data/spec/grape/integration/rack_sendfile_spec.rb +13 -9
- data/spec/grape/loading_spec.rb +8 -8
- data/spec/grape/middleware/auth/dsl_spec.rb +15 -6
- data/spec/grape/middleware/auth/strategies_spec.rb +61 -21
- data/spec/grape/middleware/base_spec.rb +24 -15
- data/spec/grape/middleware/error_spec.rb +3 -3
- data/spec/grape/middleware/exception_spec.rb +111 -161
- data/spec/grape/middleware/formatter_spec.rb +28 -7
- data/spec/grape/middleware/globals_spec.rb +7 -4
- data/spec/grape/middleware/stack_spec.rb +15 -12
- data/spec/grape/middleware/versioner/accept_version_header_spec.rb +2 -1
- data/spec/grape/middleware/versioner/header_spec.rb +14 -13
- data/spec/grape/middleware/versioner/param_spec.rb +7 -1
- data/spec/grape/middleware/versioner/path_spec.rb +5 -1
- data/spec/grape/middleware/versioner_spec.rb +1 -1
- data/spec/grape/parser_spec.rb +4 -0
- data/spec/grape/path_spec.rb +52 -52
- data/spec/grape/presenters/presenter_spec.rb +7 -6
- data/spec/grape/request_spec.rb +6 -4
- data/spec/grape/util/inheritable_setting_spec.rb +7 -7
- data/spec/grape/util/inheritable_values_spec.rb +3 -2
- data/spec/grape/util/reverse_stackable_values_spec.rb +3 -1
- data/spec/grape/util/stackable_values_spec.rb +7 -5
- data/spec/grape/validations/instance_behaivour_spec.rb +9 -10
- data/spec/grape/validations/multiple_attributes_iterator_spec.rb +14 -3
- data/spec/grape/validations/params_scope_spec.rb +72 -10
- data/spec/grape/validations/single_attribute_iterator_spec.rb +18 -6
- data/spec/grape/validations/types/primitive_coercer_spec.rb +63 -7
- data/spec/grape/validations/types_spec.rb +8 -8
- data/spec/grape/validations/validators/all_or_none_spec.rb +50 -56
- data/spec/grape/validations/validators/allow_blank_spec.rb +136 -140
- data/spec/grape/validations/validators/at_least_one_of_spec.rb +50 -56
- data/spec/grape/validations/validators/coerce_spec.rb +248 -33
- data/spec/grape/validations/validators/default_spec.rb +121 -78
- data/spec/grape/validations/validators/exactly_one_of_spec.rb +71 -77
- data/spec/grape/validations/validators/except_values_spec.rb +4 -3
- data/spec/grape/validations/validators/mutual_exclusion_spec.rb +71 -77
- data/spec/grape/validations/validators/presence_spec.rb +16 -1
- data/spec/grape/validations/validators/regexp_spec.rb +25 -31
- data/spec/grape/validations/validators/same_as_spec.rb +14 -20
- data/spec/grape/validations/validators/values_spec.rb +183 -178
- data/spec/grape/validations_spec.rb +342 -29
- data/spec/integration/eager_load/eager_load_spec.rb +15 -0
- data/spec/integration/multi_json/json_spec.rb +1 -1
- data/spec/integration/multi_xml/xml_spec.rb +1 -1
- data/spec/shared/versioning_examples.rb +32 -29
- data/spec/spec_helper.rb +12 -12
- data/spec/support/basic_auth_encode_helpers.rb +1 -1
- data/spec/support/chunks.rb +14 -0
- data/spec/support/versioned_helpers.rb +4 -6
- metadata +110 -102
@@ -7,7 +7,7 @@ shared_examples_for 'versioning' do
|
|
7
7
|
subject.get :hello do
|
8
8
|
"Version: #{request.env['api.version']}"
|
9
9
|
end
|
10
|
-
versioned_get '/hello', 'v1', macro_options
|
10
|
+
versioned_get '/hello', 'v1', **macro_options
|
11
11
|
expect(last_response.body).to eql 'Version: v1'
|
12
12
|
end
|
13
13
|
|
@@ -18,7 +18,7 @@ shared_examples_for 'versioning' do
|
|
18
18
|
subject.get :hello do
|
19
19
|
"Version: #{request.env['api.version']}"
|
20
20
|
end
|
21
|
-
versioned_get '/hello', 'v1', macro_options.merge(prefix: 'api')
|
21
|
+
versioned_get '/hello', 'v1', **macro_options.merge(prefix: 'api')
|
22
22
|
expect(last_response.body).to eql 'Version: v1'
|
23
23
|
end
|
24
24
|
|
@@ -34,15 +34,15 @@ shared_examples_for 'versioning' do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
versioned_get '/awesome', 'v1', macro_options
|
38
|
-
expect(last_response.status).to
|
37
|
+
versioned_get '/awesome', 'v1', **macro_options
|
38
|
+
expect(last_response.status).to be 404
|
39
39
|
|
40
|
-
versioned_get '/awesome', 'v2', macro_options
|
41
|
-
expect(last_response.status).to
|
42
|
-
versioned_get '/legacy', 'v1', macro_options
|
43
|
-
expect(last_response.status).to
|
44
|
-
versioned_get '/legacy', 'v2', macro_options
|
45
|
-
expect(last_response.status).to
|
40
|
+
versioned_get '/awesome', 'v2', **macro_options
|
41
|
+
expect(last_response.status).to be 200
|
42
|
+
versioned_get '/legacy', 'v1', **macro_options
|
43
|
+
expect(last_response.status).to be 200
|
44
|
+
versioned_get '/legacy', 'v2', **macro_options
|
45
|
+
expect(last_response.status).to be 404
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'is able to specify multiple versions' do
|
@@ -51,12 +51,12 @@ shared_examples_for 'versioning' do
|
|
51
51
|
'I exist'
|
52
52
|
end
|
53
53
|
|
54
|
-
versioned_get '/awesome', 'v1', macro_options
|
55
|
-
expect(last_response.status).to
|
56
|
-
versioned_get '/awesome', 'v2', macro_options
|
57
|
-
expect(last_response.status).to
|
58
|
-
versioned_get '/awesome', 'v3', macro_options
|
59
|
-
expect(last_response.status).to
|
54
|
+
versioned_get '/awesome', 'v1', **macro_options
|
55
|
+
expect(last_response.status).to be 200
|
56
|
+
versioned_get '/awesome', 'v2', **macro_options
|
57
|
+
expect(last_response.status).to be 200
|
58
|
+
versioned_get '/awesome', 'v3', **macro_options
|
59
|
+
expect(last_response.status).to be 404
|
60
60
|
end
|
61
61
|
|
62
62
|
context 'with different versions for the same endpoint' do
|
@@ -70,14 +70,14 @@ shared_examples_for 'versioning' do
|
|
70
70
|
|
71
71
|
subject.version 'v1', macro_options do
|
72
72
|
get 'version' do
|
73
|
-
|
73
|
+
"version #{request.env['api.version']}"
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
versioned_get '/version', 'v2', macro_options
|
77
|
+
versioned_get '/version', 'v2', **macro_options
|
78
78
|
expect(last_response.status).to eq(200)
|
79
79
|
expect(last_response.body).to eq('v2')
|
80
|
-
versioned_get '/version', 'v1', macro_options
|
80
|
+
versioned_get '/version', 'v1', **macro_options
|
81
81
|
expect(last_response.status).to eq(200)
|
82
82
|
expect(last_response.body).to eq('version v1')
|
83
83
|
end
|
@@ -94,15 +94,15 @@ shared_examples_for 'versioning' do
|
|
94
94
|
|
95
95
|
subject.version 'v1', macro_options do
|
96
96
|
get 'version' do
|
97
|
-
|
97
|
+
"version #{request.env['api.version']}"
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
-
versioned_get '/version', 'v1', macro_options.merge(prefix: subject.prefix)
|
101
|
+
versioned_get '/version', 'v1', **macro_options.merge(prefix: subject.prefix)
|
102
102
|
expect(last_response.status).to eq(200)
|
103
103
|
expect(last_response.body).to eq('version v1')
|
104
104
|
|
105
|
-
versioned_get '/version', 'v2', macro_options.merge(prefix: subject.prefix)
|
105
|
+
versioned_get '/version', 'v2', **macro_options.merge(prefix: subject.prefix)
|
106
106
|
expect(last_response.status).to eq(200)
|
107
107
|
expect(last_response.body).to eq('v2')
|
108
108
|
end
|
@@ -117,6 +117,7 @@ shared_examples_for 'versioning' do
|
|
117
117
|
before do
|
118
118
|
@output ||= 'v2-'
|
119
119
|
end
|
120
|
+
|
120
121
|
get 'version' do
|
121
122
|
@output += 'version'
|
122
123
|
end
|
@@ -126,16 +127,17 @@ shared_examples_for 'versioning' do
|
|
126
127
|
before do
|
127
128
|
@output ||= 'v1-'
|
128
129
|
end
|
130
|
+
|
129
131
|
get 'version' do
|
130
132
|
@output += 'version'
|
131
133
|
end
|
132
134
|
end
|
133
135
|
|
134
|
-
versioned_get '/version', 'v1', macro_options.merge(prefix: subject.prefix)
|
136
|
+
versioned_get '/version', 'v1', **macro_options.merge(prefix: subject.prefix)
|
135
137
|
expect(last_response.status).to eq(200)
|
136
138
|
expect(last_response.body).to eq('v1-version')
|
137
139
|
|
138
|
-
versioned_get '/version', 'v2', macro_options.merge(prefix: subject.prefix)
|
140
|
+
versioned_get '/version', 'v2', **macro_options.merge(prefix: subject.prefix)
|
139
141
|
expect(last_response.status).to eq(200)
|
140
142
|
expect(last_response.body).to eq('v2-version')
|
141
143
|
end
|
@@ -148,7 +150,7 @@ shared_examples_for 'versioning' do
|
|
148
150
|
subject.get :api_version_with_version_param do
|
149
151
|
params[:version]
|
150
152
|
end
|
151
|
-
versioned_get '/api_version_with_version_param?version=1', 'v1', macro_options
|
153
|
+
versioned_get '/api_version_with_version_param?version=1', 'v1', **macro_options
|
152
154
|
expect(last_response.body).to eql '1'
|
153
155
|
end
|
154
156
|
|
@@ -170,6 +172,7 @@ shared_examples_for 'versioning' do
|
|
170
172
|
end
|
171
173
|
klass
|
172
174
|
end
|
175
|
+
|
173
176
|
before do
|
174
177
|
subject.format :txt
|
175
178
|
|
@@ -183,13 +186,13 @@ shared_examples_for 'versioning' do
|
|
183
186
|
|
184
187
|
context 'v1' do
|
185
188
|
it 'finds endpoint' do
|
186
|
-
versioned_get '/version', 'v1', macro_options
|
189
|
+
versioned_get '/version', 'v1', **macro_options
|
187
190
|
expect(last_response.status).to eq(200)
|
188
191
|
expect(last_response.body).to eq('v1')
|
189
192
|
end
|
190
193
|
|
191
194
|
it 'finds catch all' do
|
192
|
-
versioned_get '/whatever', 'v1', macro_options
|
195
|
+
versioned_get '/whatever', 'v1', **macro_options
|
193
196
|
expect(last_response.status).to eq(200)
|
194
197
|
expect(last_response.body).to end_with 'whatever'
|
195
198
|
end
|
@@ -197,13 +200,13 @@ shared_examples_for 'versioning' do
|
|
197
200
|
|
198
201
|
context 'v2' do
|
199
202
|
it 'finds endpoint' do
|
200
|
-
versioned_get '/version', 'v2', macro_options
|
203
|
+
versioned_get '/version', 'v2', **macro_options
|
201
204
|
expect(last_response.status).to eq(200)
|
202
205
|
expect(last_response.body).to eq('v2')
|
203
206
|
end
|
204
207
|
|
205
208
|
it 'finds catch all' do
|
206
|
-
versioned_get '/whatever', 'v2', macro_options
|
209
|
+
versioned_get '/whatever', 'v2', **macro_options
|
207
210
|
expect(last_response.status).to eq(200)
|
208
211
|
expect(last_response.body).to end_with 'whatever'
|
209
212
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -5,12 +5,21 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
5
5
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'support'))
|
6
6
|
|
7
7
|
require 'grape'
|
8
|
+
require 'test_prof/recipes/rspec/let_it_be'
|
9
|
+
|
10
|
+
class NullAdapter
|
11
|
+
def begin_transaction; end
|
12
|
+
|
13
|
+
def rollback_transaction; end
|
14
|
+
end
|
15
|
+
|
16
|
+
TestProf::BeforeAll.adapter = NullAdapter.new
|
8
17
|
|
9
18
|
require 'rubygems'
|
10
19
|
require 'bundler'
|
11
20
|
Bundler.require :default, :test
|
12
21
|
|
13
|
-
Dir["#{File.dirname(__FILE__)}/support/*.rb"].each do |file|
|
22
|
+
Dir["#{File.dirname(__FILE__)}/support/*.rb"].sort.each do |file|
|
14
23
|
require file
|
15
24
|
end
|
16
25
|
|
@@ -20,24 +29,15 @@ eager_load!
|
|
20
29
|
# so it should be set to true here as well to reflect that.
|
21
30
|
I18n.enforce_available_locales = true
|
22
31
|
|
23
|
-
module Chunks
|
24
|
-
def read_chunks(body)
|
25
|
-
buffer = []
|
26
|
-
body.each { |chunk| buffer << chunk }
|
27
|
-
|
28
|
-
buffer
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
32
|
RSpec.configure do |config|
|
33
|
-
config.include Chunks
|
34
33
|
config.include Rack::Test::Methods
|
35
34
|
config.include Spec::Support::Helpers
|
36
35
|
config.raise_errors_for_deprecations!
|
37
36
|
config.filter_run_when_matching :focus
|
38
37
|
config.warnings = true
|
39
38
|
|
40
|
-
config.before(:
|
39
|
+
config.before(:all) { Grape::Util::InheritableSetting.reset_global! }
|
40
|
+
config.before { Grape::Util::InheritableSetting.reset_global! }
|
41
41
|
|
42
42
|
# Enable flags like --only-failures and --next-failure
|
43
43
|
config.example_status_persistence_file_path = '.rspec_status'
|
@@ -6,7 +6,7 @@ module Spec
|
|
6
6
|
module Helpers
|
7
7
|
# Returns the path with options[:version] prefixed if options[:using] is :path.
|
8
8
|
# Returns normal path otherwise.
|
9
|
-
def versioned_path(options
|
9
|
+
def versioned_path(**options)
|
10
10
|
case options[:using]
|
11
11
|
when :path
|
12
12
|
File.join('/', options[:prefix] || '', options[:version], options[:path])
|
@@ -43,13 +43,11 @@ module Spec
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
def versioned_get(path, version_name, version_options
|
47
|
-
path
|
46
|
+
def versioned_get(path, version_name, **version_options)
|
47
|
+
path = versioned_path(**version_options.merge(version: version_name, path: path))
|
48
48
|
headers = versioned_headers(**version_options.merge(version: version_name))
|
49
49
|
params = {}
|
50
|
-
if version_options[:using] == :param
|
51
|
-
params = { version_options[:parameter] => version_name }
|
52
|
-
end
|
50
|
+
params = { version_options[:parameter] => version_name } if version_options[:using] == :param
|
53
51
|
get path, params, headers
|
54
52
|
end
|
55
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bleigh
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -137,6 +137,7 @@ files:
|
|
137
137
|
- lib/grape/error_formatter/txt.rb
|
138
138
|
- lib/grape/error_formatter/xml.rb
|
139
139
|
- lib/grape/exceptions/base.rb
|
140
|
+
- lib/grape/exceptions/empty_message_body.rb
|
140
141
|
- lib/grape/exceptions/incompatible_option_values.rb
|
141
142
|
- lib/grape/exceptions/invalid_accept_header.rb
|
142
143
|
- lib/grape/exceptions/invalid_formatter.rb
|
@@ -197,9 +198,9 @@ files:
|
|
197
198
|
- lib/grape/router/attribute_translator.rb
|
198
199
|
- lib/grape/router/pattern.rb
|
199
200
|
- lib/grape/router/route.rb
|
200
|
-
- lib/grape/
|
201
|
-
- lib/grape/
|
202
|
-
- lib/grape/
|
201
|
+
- lib/grape/serve_stream/file_body.rb
|
202
|
+
- lib/grape/serve_stream/sendfile_response.rb
|
203
|
+
- lib/grape/serve_stream/stream_response.rb
|
203
204
|
- lib/grape/util/base_inheritable.rb
|
204
205
|
- lib/grape/util/cache.rb
|
205
206
|
- lib/grape/util/endpoint_configuration.rb
|
@@ -227,6 +228,7 @@ files:
|
|
227
228
|
- lib/grape/validations/types/custom_type_collection_coercer.rb
|
228
229
|
- lib/grape/validations/types/dry_type_coercer.rb
|
229
230
|
- lib/grape/validations/types/file.rb
|
231
|
+
- lib/grape/validations/types/invalid_value.rb
|
230
232
|
- lib/grape/validations/types/json.rb
|
231
233
|
- lib/grape/validations/types/multiple_type_coercer.rb
|
232
234
|
- lib/grape/validations/types/primitive_coercer.rb
|
@@ -282,6 +284,7 @@ files:
|
|
282
284
|
- spec/grape/dsl/routing_spec.rb
|
283
285
|
- spec/grape/dsl/settings_spec.rb
|
284
286
|
- spec/grape/dsl/validations_spec.rb
|
287
|
+
- spec/grape/endpoint/declared_spec.rb
|
285
288
|
- spec/grape/endpoint_spec.rb
|
286
289
|
- spec/grape/entity_spec.rb
|
287
290
|
- spec/grape/exceptions/base_spec.rb
|
@@ -350,11 +353,13 @@ files:
|
|
350
353
|
- spec/grape/validations/validators/values_spec.rb
|
351
354
|
- spec/grape/validations/validators/zh-CN.yml
|
352
355
|
- spec/grape/validations_spec.rb
|
356
|
+
- spec/integration/eager_load/eager_load_spec.rb
|
353
357
|
- spec/integration/multi_json/json_spec.rb
|
354
358
|
- spec/integration/multi_xml/xml_spec.rb
|
355
359
|
- spec/shared/versioning_examples.rb
|
356
360
|
- spec/spec_helper.rb
|
357
361
|
- spec/support/basic_auth_encode_helpers.rb
|
362
|
+
- spec/support/chunks.rb
|
358
363
|
- spec/support/content_type_helpers.rb
|
359
364
|
- spec/support/eager_load.rb
|
360
365
|
- spec/support/endpoint_faker.rb
|
@@ -366,10 +371,10 @@ licenses:
|
|
366
371
|
- MIT
|
367
372
|
metadata:
|
368
373
|
bug_tracker_uri: https://github.com/ruby-grape/grape/issues
|
369
|
-
changelog_uri: https://github.com/ruby-grape/grape/blob/v1.
|
370
|
-
documentation_uri: https://www.rubydoc.info/gems/grape/1.
|
371
|
-
source_code_uri: https://github.com/ruby-grape/grape/tree/v1.
|
372
|
-
post_install_message:
|
374
|
+
changelog_uri: https://github.com/ruby-grape/grape/blob/v1.6.2/CHANGELOG.md
|
375
|
+
documentation_uri: https://www.rubydoc.info/gems/grape/1.6.2
|
376
|
+
source_code_uri: https://github.com/ruby-grape/grape/tree/v1.6.2
|
377
|
+
post_install_message:
|
373
378
|
rdoc_options: []
|
374
379
|
require_paths:
|
375
380
|
- lib
|
@@ -377,127 +382,130 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
377
382
|
requirements:
|
378
383
|
- - ">="
|
379
384
|
- !ruby/object:Gem::Version
|
380
|
-
version: 2.
|
385
|
+
version: 2.5.0
|
381
386
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
382
387
|
requirements:
|
383
388
|
- - ">="
|
384
389
|
- !ruby/object:Gem::Version
|
385
390
|
version: '0'
|
386
391
|
requirements: []
|
387
|
-
rubygems_version: 3.0.
|
388
|
-
signing_key:
|
392
|
+
rubygems_version: 3.3.0.dev
|
393
|
+
signing_key:
|
389
394
|
specification_version: 4
|
390
395
|
summary: A simple Ruby framework for building REST-like APIs.
|
391
396
|
test_files:
|
392
|
-
- spec/shared/versioning_examples.rb
|
393
|
-
- spec/support/versioned_helpers.rb
|
394
|
-
- spec/support/content_type_helpers.rb
|
395
|
-
- spec/support/eager_load.rb
|
396
|
-
- spec/support/basic_auth_encode_helpers.rb
|
397
|
-
- spec/support/file_streamer.rb
|
398
|
-
- spec/support/endpoint_faker.rb
|
399
|
-
- spec/support/integer_helpers.rb
|
400
|
-
- spec/grape/api/namespace_parameters_in_route_spec.rb
|
401
|
-
- spec/grape/api/routes_with_requirements_spec.rb
|
402
|
-
- spec/grape/api/nested_helpers_spec.rb
|
403
|
-
- spec/grape/api/required_parameters_in_route_spec.rb
|
404
|
-
- spec/grape/api/shared_helpers_exactly_one_of_spec.rb
|
405
|
-
- spec/grape/api/parameters_modification_spec.rb
|
406
|
-
- spec/grape/api/optional_parameters_in_route_spec.rb
|
407
|
-
- spec/grape/api/inherited_helpers_spec.rb
|
408
|
-
- spec/grape/api/required_parameters_with_invalid_method_spec.rb
|
409
397
|
- spec/grape/api/custom_validations_spec.rb
|
410
|
-
- spec/grape/api/defines_boolean_in_params_spec.rb
|
411
|
-
- spec/grape/api/shared_helpers_spec.rb
|
412
|
-
- spec/grape/api/invalid_format_spec.rb
|
413
398
|
- spec/grape/api/deeply_included_options_spec.rb
|
399
|
+
- spec/grape/api/defines_boolean_in_params_spec.rb
|
400
|
+
- spec/grape/api/inherited_helpers_spec.rb
|
414
401
|
- spec/grape/api/instance_spec.rb
|
402
|
+
- spec/grape/api/invalid_format_spec.rb
|
403
|
+
- spec/grape/api/namespace_parameters_in_route_spec.rb
|
404
|
+
- spec/grape/api/nested_helpers_spec.rb
|
405
|
+
- spec/grape/api/optional_parameters_in_route_spec.rb
|
406
|
+
- spec/grape/api/parameters_modification_spec.rb
|
415
407
|
- spec/grape/api/patch_method_helpers_spec.rb
|
416
408
|
- spec/grape/api/recognize_path_spec.rb
|
409
|
+
- spec/grape/api/required_parameters_in_route_spec.rb
|
410
|
+
- spec/grape/api/required_parameters_with_invalid_method_spec.rb
|
411
|
+
- spec/grape/api/routes_with_requirements_spec.rb
|
412
|
+
- spec/grape/api/shared_helpers_exactly_one_of_spec.rb
|
413
|
+
- spec/grape/api/shared_helpers_spec.rb
|
417
414
|
- spec/grape/api_remount_spec.rb
|
418
|
-
- spec/grape/
|
419
|
-
- spec/grape/validations/attributes_iterator_spec.rb
|
420
|
-
- spec/grape/validations/types/array_coercer_spec.rb
|
421
|
-
- spec/grape/validations/types/set_coercer_spec.rb
|
422
|
-
- spec/grape/validations/types/primitive_coercer_spec.rb
|
423
|
-
- spec/grape/validations/validators/regexp_spec.rb
|
424
|
-
- spec/grape/validations/validators/default_spec.rb
|
425
|
-
- spec/grape/validations/validators/values_spec.rb
|
426
|
-
- spec/grape/validations/validators/same_as_spec.rb
|
427
|
-
- spec/grape/validations/validators/mutual_exclusion_spec.rb
|
428
|
-
- spec/grape/validations/validators/except_values_spec.rb
|
429
|
-
- spec/grape/validations/validators/exactly_one_of_spec.rb
|
430
|
-
- spec/grape/validations/validators/allow_blank_spec.rb
|
431
|
-
- spec/grape/validations/validators/coerce_spec.rb
|
432
|
-
- spec/grape/validations/validators/presence_spec.rb
|
433
|
-
- spec/grape/validations/validators/at_least_one_of_spec.rb
|
434
|
-
- spec/grape/validations/validators/zh-CN.yml
|
435
|
-
- spec/grape/validations/validators/all_or_none_spec.rb
|
436
|
-
- spec/grape/validations/params_scope_spec.rb
|
437
|
-
- spec/grape/validations/multiple_attributes_iterator_spec.rb
|
438
|
-
- spec/grape/validations/instance_behaivour_spec.rb
|
439
|
-
- spec/grape/validations/single_attribute_iterator_spec.rb
|
415
|
+
- spec/grape/api_spec.rb
|
440
416
|
- spec/grape/config_spec.rb
|
441
|
-
- spec/grape/
|
417
|
+
- spec/grape/dsl/callbacks_spec.rb
|
418
|
+
- spec/grape/dsl/configuration_spec.rb
|
419
|
+
- spec/grape/dsl/desc_spec.rb
|
420
|
+
- spec/grape/dsl/headers_spec.rb
|
421
|
+
- spec/grape/dsl/helpers_spec.rb
|
422
|
+
- spec/grape/dsl/inside_route_spec.rb
|
423
|
+
- spec/grape/dsl/logger_spec.rb
|
424
|
+
- spec/grape/dsl/middleware_spec.rb
|
425
|
+
- spec/grape/dsl/parameters_spec.rb
|
426
|
+
- spec/grape/dsl/request_response_spec.rb
|
427
|
+
- spec/grape/dsl/routing_spec.rb
|
428
|
+
- spec/grape/dsl/settings_spec.rb
|
429
|
+
- spec/grape/dsl/validations_spec.rb
|
430
|
+
- spec/grape/endpoint/declared_spec.rb
|
431
|
+
- spec/grape/endpoint_spec.rb
|
432
|
+
- spec/grape/entity_spec.rb
|
433
|
+
- spec/grape/exceptions/base_spec.rb
|
442
434
|
- spec/grape/exceptions/body_parse_errors_spec.rb
|
443
|
-
- spec/grape/exceptions/missing_option_spec.rb
|
444
435
|
- spec/grape/exceptions/invalid_accept_header_spec.rb
|
445
|
-
- spec/grape/exceptions/validation_spec.rb
|
446
|
-
- spec/grape/exceptions/unknown_validator_spec.rb
|
447
|
-
- spec/grape/exceptions/validation_errors_spec.rb
|
448
|
-
- spec/grape/exceptions/invalid_response_spec.rb
|
449
|
-
- spec/grape/exceptions/unknown_options_spec.rb
|
450
436
|
- spec/grape/exceptions/invalid_formatter_spec.rb
|
437
|
+
- spec/grape/exceptions/invalid_response_spec.rb
|
451
438
|
- spec/grape/exceptions/invalid_versioner_option_spec.rb
|
452
439
|
- spec/grape/exceptions/missing_mime_type_spec.rb
|
453
|
-
- spec/grape/exceptions/
|
454
|
-
- spec/grape/
|
455
|
-
- spec/grape/
|
456
|
-
- spec/grape/
|
457
|
-
- spec/grape/
|
458
|
-
- spec/grape/util/reverse_stackable_values_spec.rb
|
459
|
-
- spec/grape/util/inheritable_values_spec.rb
|
460
|
-
- spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb
|
440
|
+
- spec/grape/exceptions/missing_option_spec.rb
|
441
|
+
- spec/grape/exceptions/unknown_options_spec.rb
|
442
|
+
- spec/grape/exceptions/unknown_validator_spec.rb
|
443
|
+
- spec/grape/exceptions/validation_errors_spec.rb
|
444
|
+
- spec/grape/exceptions/validation_spec.rb
|
461
445
|
- spec/grape/extensions/param_builders/hash_spec.rb
|
446
|
+
- spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb
|
462
447
|
- spec/grape/extensions/param_builders/hashie/mash_spec.rb
|
463
|
-
- spec/grape/integration/rack_spec.rb
|
464
|
-
- spec/grape/integration/rack_sendfile_spec.rb
|
465
448
|
- spec/grape/integration/global_namespace_function_spec.rb
|
466
|
-
- spec/grape/
|
467
|
-
- spec/grape/
|
468
|
-
- spec/grape/
|
449
|
+
- spec/grape/integration/rack_sendfile_spec.rb
|
450
|
+
- spec/grape/integration/rack_spec.rb
|
451
|
+
- spec/grape/loading_spec.rb
|
452
|
+
- spec/grape/middleware/auth/base_spec.rb
|
453
|
+
- spec/grape/middleware/auth/dsl_spec.rb
|
454
|
+
- spec/grape/middleware/auth/strategies_spec.rb
|
455
|
+
- spec/grape/middleware/base_spec.rb
|
456
|
+
- spec/grape/middleware/error_spec.rb
|
469
457
|
- spec/grape/middleware/exception_spec.rb
|
470
|
-
- spec/grape/middleware/
|
471
|
-
- spec/grape/middleware/versioner/header_spec.rb
|
472
|
-
- spec/grape/middleware/versioner/path_spec.rb
|
473
|
-
- spec/grape/middleware/versioner/accept_version_header_spec.rb
|
458
|
+
- spec/grape/middleware/formatter_spec.rb
|
474
459
|
- spec/grape/middleware/globals_spec.rb
|
475
460
|
- spec/grape/middleware/stack_spec.rb
|
476
|
-
- spec/grape/middleware/
|
477
|
-
- spec/grape/middleware/
|
478
|
-
- spec/grape/middleware/
|
479
|
-
- spec/grape/middleware/
|
480
|
-
- spec/grape/middleware/auth/base_spec.rb
|
461
|
+
- spec/grape/middleware/versioner/accept_version_header_spec.rb
|
462
|
+
- spec/grape/middleware/versioner/header_spec.rb
|
463
|
+
- spec/grape/middleware/versioner/param_spec.rb
|
464
|
+
- spec/grape/middleware/versioner/path_spec.rb
|
481
465
|
- spec/grape/middleware/versioner_spec.rb
|
482
|
-
- spec/grape/middleware/base_spec.rb
|
483
|
-
- spec/grape/entity_spec.rb
|
484
|
-
- spec/grape/dsl/settings_spec.rb
|
485
|
-
- spec/grape/dsl/callbacks_spec.rb
|
486
|
-
- spec/grape/dsl/middleware_spec.rb
|
487
|
-
- spec/grape/dsl/inside_route_spec.rb
|
488
|
-
- spec/grape/dsl/configuration_spec.rb
|
489
|
-
- spec/grape/dsl/parameters_spec.rb
|
490
|
-
- spec/grape/dsl/logger_spec.rb
|
491
|
-
- spec/grape/dsl/helpers_spec.rb
|
492
|
-
- spec/grape/dsl/request_response_spec.rb
|
493
|
-
- spec/grape/dsl/routing_spec.rb
|
494
|
-
- spec/grape/dsl/headers_spec.rb
|
495
|
-
- spec/grape/dsl/validations_spec.rb
|
496
|
-
- spec/grape/dsl/desc_spec.rb
|
497
|
-
- spec/grape/validations_spec.rb
|
498
466
|
- spec/grape/named_api_spec.rb
|
499
|
-
- spec/grape/
|
467
|
+
- spec/grape/parser_spec.rb
|
468
|
+
- spec/grape/path_spec.rb
|
469
|
+
- spec/grape/presenters/presenter_spec.rb
|
500
470
|
- spec/grape/request_spec.rb
|
501
|
-
- spec/
|
471
|
+
- spec/grape/util/inheritable_setting_spec.rb
|
472
|
+
- spec/grape/util/inheritable_values_spec.rb
|
473
|
+
- spec/grape/util/reverse_stackable_values_spec.rb
|
474
|
+
- spec/grape/util/stackable_values_spec.rb
|
475
|
+
- spec/grape/util/strict_hash_configuration_spec.rb
|
476
|
+
- spec/grape/validations/attributes_iterator_spec.rb
|
477
|
+
- spec/grape/validations/instance_behaivour_spec.rb
|
478
|
+
- spec/grape/validations/multiple_attributes_iterator_spec.rb
|
479
|
+
- spec/grape/validations/params_scope_spec.rb
|
480
|
+
- spec/grape/validations/single_attribute_iterator_spec.rb
|
481
|
+
- spec/grape/validations/types/array_coercer_spec.rb
|
482
|
+
- spec/grape/validations/types/primitive_coercer_spec.rb
|
483
|
+
- spec/grape/validations/types/set_coercer_spec.rb
|
484
|
+
- spec/grape/validations/types_spec.rb
|
485
|
+
- spec/grape/validations/validators/all_or_none_spec.rb
|
486
|
+
- spec/grape/validations/validators/allow_blank_spec.rb
|
487
|
+
- spec/grape/validations/validators/at_least_one_of_spec.rb
|
488
|
+
- spec/grape/validations/validators/coerce_spec.rb
|
489
|
+
- spec/grape/validations/validators/default_spec.rb
|
490
|
+
- spec/grape/validations/validators/exactly_one_of_spec.rb
|
491
|
+
- spec/grape/validations/validators/except_values_spec.rb
|
492
|
+
- spec/grape/validations/validators/mutual_exclusion_spec.rb
|
493
|
+
- spec/grape/validations/validators/presence_spec.rb
|
494
|
+
- spec/grape/validations/validators/regexp_spec.rb
|
495
|
+
- spec/grape/validations/validators/same_as_spec.rb
|
496
|
+
- spec/grape/validations/validators/values_spec.rb
|
497
|
+
- spec/grape/validations/validators/zh-CN.yml
|
498
|
+
- spec/grape/validations_spec.rb
|
499
|
+
- spec/integration/eager_load/eager_load_spec.rb
|
502
500
|
- spec/integration/multi_json/json_spec.rb
|
501
|
+
- spec/integration/multi_xml/xml_spec.rb
|
502
|
+
- spec/shared/versioning_examples.rb
|
503
503
|
- spec/spec_helper.rb
|
504
|
+
- spec/support/basic_auth_encode_helpers.rb
|
505
|
+
- spec/support/chunks.rb
|
506
|
+
- spec/support/content_type_helpers.rb
|
507
|
+
- spec/support/eager_load.rb
|
508
|
+
- spec/support/endpoint_faker.rb
|
509
|
+
- spec/support/file_streamer.rb
|
510
|
+
- spec/support/integer_helpers.rb
|
511
|
+
- spec/support/versioned_helpers.rb
|