grape 1.7.0 → 1.7.1
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/CHANGELOG.md +25 -0
- data/CONTRIBUTING.md +30 -0
- data/README.md +27 -5
- data/grape.gemspec +2 -2
- data/lib/grape/dsl/desc.rb +2 -1
- data/lib/grape/dsl/inside_route.rb +1 -1
- data/lib/grape/dsl/parameters.rb +6 -1
- data/lib/grape/dsl/request_response.rb +1 -1
- data/lib/grape/endpoint.rb +2 -2
- data/lib/grape/exceptions/base.rb +2 -1
- data/lib/grape/middleware/stack.rb +1 -1
- data/lib/grape/request.rb +1 -1
- data/lib/grape/router/attribute_translator.rb +1 -1
- data/lib/grape/types/invalid_value.rb +8 -0
- data/lib/grape/util/cache.rb +1 -1
- data/lib/grape/validations/params_scope.rb +1 -1
- data/lib/grape/validations/types/invalid_value.rb +0 -7
- data/lib/grape/version.rb +1 -1
- data/lib/grape.rb +8 -0
- data/spec/grape/api_spec.rb +5 -20
- data/spec/grape/dsl/desc_spec.rb +2 -0
- data/spec/grape/endpoint_spec.rb +8 -7
- data/spec/grape/exceptions/invalid_accept_header_spec.rb +3 -0
- data/spec/grape/integration/rack_spec.rb +6 -5
- data/spec/grape/middleware/base_spec.rb +7 -5
- data/spec/grape/middleware/formatter_spec.rb +6 -6
- data/spec/grape/validations/validators/values_spec.rb +19 -0
- data/spec/grape/validations_spec.rb +29 -6
- metadata +114 -111
- data/spec/grape/dsl/configuration_spec.rb +0 -14
- data/spec/grape/validations/attributes_iterator_spec.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40277732454d8810e4e96f638da9e6bd4ab818e39ac9c30788791cb4bd429871
|
4
|
+
data.tar.gz: b075dd96ba3dda6fcd05e6b1c126255b5e206b2d6bb9bf9b52f9cd6ec25a6efc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d1ef36c90927e08119b6abf57b87fc5317b7b4ac73587d14bc23c9b671e0e76930b89b22d15ec806861f2c60c582647a4f95bc6a1100dca07066be1853d4e6
|
7
|
+
data.tar.gz: 42a4595d466b2092759dee55ad467a6733e29912b0faaf3abe203c18ab1c84b53b6a1d45868102ac16e6b431254664a6762b3ec0b8e52217c777f99adcf965cc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
### 1.7.1 (2023/05/14)
|
2
|
+
|
3
|
+
#### Features
|
4
|
+
|
5
|
+
* [#2288](https://github.com/ruby-grape/grape/pull/2288): Droped support for Ruby 2.5 - [@ericproulx](https://github.com/ericproulx).
|
6
|
+
* [#2288](https://github.com/ruby-grape/grape/pull/2288): Updated rubocop to 1.41.0 - [@ericproulx](https://github.com/ericproulx).
|
7
|
+
* [#2296](https://github.com/ruby-grape/grape/pull/2296): Fix cops and enables some - [@ericproulx](https://github.com/ericproulx).
|
8
|
+
* [#2302](https://github.com/ruby-grape/grape/pull/2302): Rack < 3 and update rack-test - [@ericproulx](https://github.com/ericproulx).
|
9
|
+
* [#2303](https://github.com/ruby-grape/grape/pull/2302): Rack >= 1.3.0 - [@ericproulx](https://github.com/ericproulx).
|
10
|
+
* [#2301](https://github.com/ruby-grape/grape/pull/2301): Revisit GH workflows - [@ericproulx](https://github.com/ericproulx).
|
11
|
+
* [#2311](https://github.com/ruby-grape/grape/pull/2311): Fix tests by pinning rack-test to < 2.1 - [@duffn](https://github.com/duffn).
|
12
|
+
* [#2310](https://github.com/ruby-grape/grape/pull/2310): Fix YARD docs markdown rendering - [@duffn](https://github.com/duffn).
|
13
|
+
* [#2317](https://github.com/ruby-grape/grape/pull/2317): Remove maruku and rubocop-ast as direct development/testing dependencies - [@ericproulx](https://github.com/ericproulx).
|
14
|
+
* [#2292](https://github.com/ruby-grape/grape/pull/2292): Introduce Docker to local development - [@ericproulx](https://github.com/ericproulx).
|
15
|
+
* [#2325](https://github.com/ruby-grape/grape/pull/2325): Change edge test workflows only run on demand - [@dblock](https://github.com/dblock).
|
16
|
+
* [#2324](https://github.com/ruby-grape/grape/pull/2324): Expose default in the description dsl - [@dhruvCW](https://github.com/dhruvCW).
|
17
|
+
|
18
|
+
#### Fixes
|
19
|
+
|
20
|
+
* [#2299](https://github.com/ruby-grape/grape/pull/2299): Fix, do not use kwargs for empty args - [@dm1try](https://github.com/dm1try).
|
21
|
+
* [#2307](https://github.com/ruby-grape/grape/pull/2307): Fixed autoloading of InvalidValue - [@fixlr](https://github.com/fixlr).
|
22
|
+
* [#2315](https://github.com/ruby-grape/grape/pull/2315): Update rspec - [@ericproulx](https://github.com/ericproulx).
|
23
|
+
* [#2319](https://github.com/ruby-grape/grape/pull/2319): Update rubocop - [@ericproulx](https://github.com/ericproulx).
|
24
|
+
* [#2323](https://github.com/ruby-grape/grape/pull/2323): Fix using endless ranges for values parameter - [@dhruvCW](https://github.com/dhruvCW).
|
25
|
+
|
1
26
|
### 1.7.0 (2022/12/20)
|
2
27
|
|
3
28
|
#### Features
|
data/CONTRIBUTING.md
CHANGED
@@ -23,6 +23,34 @@ git pull upstream master
|
|
23
23
|
git checkout -b my-feature-branch
|
24
24
|
```
|
25
25
|
|
26
|
+
### Docker
|
27
|
+
|
28
|
+
If you're familiar with [Docker](https://www.docker.com/), you can run everything through the following command:
|
29
|
+
|
30
|
+
```
|
31
|
+
docker-compose run --rm --build grape <command_and_parameters>
|
32
|
+
```
|
33
|
+
|
34
|
+
About the execution process:
|
35
|
+
- displays Ruby, Rubygems, Bundle and Gemfile version when starting:
|
36
|
+
```
|
37
|
+
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux-musl]
|
38
|
+
rubygems 3.4.12
|
39
|
+
Bundler version 2.4.1 (2022-12-24 commit f3175f033c)
|
40
|
+
Running default Gemfile
|
41
|
+
```
|
42
|
+
- keeps the gems to the latest possible version
|
43
|
+
- executes under `bundle exec`
|
44
|
+
|
45
|
+
Here are some examples:
|
46
|
+
|
47
|
+
- running all specs `docker-compose run --rm --build grape rspec`
|
48
|
+
- running rspec on a specific file `docker-compose run --rm --build grape rspec spec/:file_path`
|
49
|
+
- running task `docker-compose run --rm --build grape rake <task_name>`
|
50
|
+
- running rubocop `docker-compose run --rm --build grape rubocop`
|
51
|
+
- running all specs on a specific ruby version (e.g 2.7.7) `RUBY_VERSION=2.7.7 docker-compose run --rm --build grape rspec`
|
52
|
+
- running specs on a specific gemfile (e.g rails_7_0.gemfile) `docker-compose run -e GEMFILE=rails_7_0 --rm --build grape rspec`
|
53
|
+
|
26
54
|
#### Bundle Install and Test
|
27
55
|
|
28
56
|
Ensure that you can build the project and run tests.
|
@@ -58,6 +86,8 @@ Make sure that `bundle exec rake` completes without errors.
|
|
58
86
|
|
59
87
|
Document any external behavior in the [README](README.md).
|
60
88
|
|
89
|
+
You should also document code as necessary, using current code as examples. This project uses [YARD](https://yardoc.org/). You can run and preview the docs locally by [installing `yard`](https://yardoc.org/), running `yard server --reload` and view the docs at http://localhost:8808.
|
90
|
+
|
61
91
|
#### Update Changelog
|
62
92
|
|
63
93
|
Add a line to [CHANGELOG](CHANGELOG.md) under *Next Release*. Make it look like every other line, including your name and link to your Github account.
|
data/README.md
CHANGED
@@ -159,7 +159,7 @@ content negotiation, versioning and much more.
|
|
159
159
|
|
160
160
|
## Stable Release
|
161
161
|
|
162
|
-
You're reading the documentation for the stable release of Grape, 1.7.
|
162
|
+
You're reading the documentation for the stable release of Grape, 1.7.1.
|
163
163
|
Please read [UPGRADING](UPGRADING.md) when upgrading from a previous version.
|
164
164
|
|
165
165
|
## Project Resources
|
@@ -538,12 +538,12 @@ end
|
|
538
538
|
|
539
539
|
class V1 < Grape::API
|
540
540
|
version 'v1'
|
541
|
-
mount BasicAPI, with: { entity: mounted { configuration[:entity] || API::
|
541
|
+
mount BasicAPI, with: { entity: mounted { configuration[:entity] || API::Entities::Status } }
|
542
542
|
end
|
543
543
|
|
544
544
|
class V2 < Grape::API
|
545
545
|
version 'v2'
|
546
|
-
mount BasicAPI, with: { entity: mounted { configuration[:entity] || API::
|
546
|
+
mount BasicAPI, with: { entity: mounted { configuration[:entity] || API::Entities::V2::Status } }
|
547
547
|
end
|
548
548
|
```
|
549
549
|
|
@@ -638,6 +638,7 @@ desc 'Returns your public timeline.' do
|
|
638
638
|
params API::Entities::Status.documentation
|
639
639
|
success API::Entities::Entity
|
640
640
|
failure [[401, 'Unauthorized', 'Entities::Error']]
|
641
|
+
default { code: 500, message: 'InvalidRequest', model: Entities::Error }
|
641
642
|
named 'My named route'
|
642
643
|
headers XAuthToken: {
|
643
644
|
description: 'Validates your identity',
|
@@ -662,8 +663,9 @@ end
|
|
662
663
|
|
663
664
|
* `detail`: A more enhanced description
|
664
665
|
* `params`: Define parameters directly from an `Entity`
|
665
|
-
* `success`: (former entity) The `Entity` to be used to present
|
666
|
-
* `failure`: (former http_codes) A definition of the used failure HTTP Codes and Entities
|
666
|
+
* `success`: (former entity) The `Entity` to be used to present the success response for this route.
|
667
|
+
* `failure`: (former http_codes) A definition of the used failure HTTP Codes and Entities.
|
668
|
+
* `default`: The definition and `Entity` used to present the default response for this route.
|
667
669
|
* `named`: A helper to give a route a name and find it with this name in the documentation Hash
|
668
670
|
* `headers`: A definition of the used Headers
|
669
671
|
* Other options can be found in [grape-swagger][grape-swagger]
|
@@ -1586,6 +1588,15 @@ params do
|
|
1586
1588
|
end
|
1587
1589
|
```
|
1588
1590
|
|
1591
|
+
Note endless ranges are also supported with ActiveSupport >= 6.0, but they require that the type be provided.
|
1592
|
+
|
1593
|
+
```ruby
|
1594
|
+
params do
|
1595
|
+
requires :minimum, type: Integer, values: 10..
|
1596
|
+
optional :maximum, type: Integer, values: ..10
|
1597
|
+
end
|
1598
|
+
```
|
1599
|
+
|
1589
1600
|
Note that *both* range endpoints have to be a `#kind_of?` your `:type` option (if you don't supply the `:type` option, it will be guessed to be equal to the class of the range's first endpoint). So the following is invalid:
|
1590
1601
|
|
1591
1602
|
```ruby
|
@@ -3340,6 +3351,17 @@ end
|
|
3340
3351
|
|
3341
3352
|
Use `body false` to return `204 No Content` without any data or content-type.
|
3342
3353
|
|
3354
|
+
If you want to empty the body with an HTTP status code other than `204 No Content`, you can override the status code after specifying `body false` as follows
|
3355
|
+
|
3356
|
+
```ruby
|
3357
|
+
class API < Grape::API
|
3358
|
+
get '/' do
|
3359
|
+
body false
|
3360
|
+
status 304
|
3361
|
+
end
|
3362
|
+
end
|
3363
|
+
```
|
3364
|
+
|
3343
3365
|
You can also set the response to a file with `sendfile`. This works with the
|
3344
3366
|
[Rack::Sendfile](https://www.rubydoc.info/gems/rack/Rack/Sendfile) middleware to optimally send
|
3345
3367
|
the file through your web server software.
|
data/grape.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_runtime_dependency 'builder'
|
25
25
|
s.add_runtime_dependency 'dry-types', '>= 1.1'
|
26
26
|
s.add_runtime_dependency 'mustermann-grape', '~> 1.0.0'
|
27
|
-
s.add_runtime_dependency 'rack', '>= 1.3.0'
|
27
|
+
s.add_runtime_dependency 'rack', '>= 1.3.0', '< 3'
|
28
28
|
s.add_runtime_dependency 'rack-accept'
|
29
29
|
|
30
30
|
s.files = %w[CHANGELOG.md CONTRIBUTING.md README.md grape.png UPGRADING.md LICENSE]
|
@@ -32,5 +32,5 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.files += Dir['lib/**/*']
|
33
33
|
s.test_files = Dir['spec/**/*']
|
34
34
|
s.require_paths = ['lib']
|
35
|
-
s.required_ruby_version = '>= 2.
|
35
|
+
s.required_ruby_version = '>= 2.6.0'
|
36
36
|
end
|
data/lib/grape/dsl/desc.rb
CHANGED
@@ -95,7 +95,7 @@ module Grape
|
|
95
95
|
return yield if has_passed_children
|
96
96
|
|
97
97
|
key = params_nested_path[0]
|
98
|
-
key += "[#{params_nested_path[1
|
98
|
+
key += "[#{params_nested_path[1..].join('][')}]" if params_nested_path.size > 1
|
99
99
|
|
100
100
|
route_options_params = options[:route_options][:params] || {}
|
101
101
|
type = route_options_params.dig(key, :type)
|
data/lib/grape/dsl/parameters.rb
CHANGED
@@ -62,7 +62,12 @@ module Grape
|
|
62
62
|
params_block = named_params.fetch(name) do
|
63
63
|
raise "Params :#{name} not found!"
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
|
+
if options.empty?
|
67
|
+
instance_exec(options, ¶ms_block)
|
68
|
+
else
|
69
|
+
instance_exec(**options, ¶ms_block)
|
70
|
+
end
|
66
71
|
end
|
67
72
|
end
|
68
73
|
alias use_scope use
|
@@ -125,7 +125,7 @@ module Grape
|
|
125
125
|
:base_only_rescue_handlers
|
126
126
|
end
|
127
127
|
|
128
|
-
namespace_reverse_stackable
|
128
|
+
namespace_reverse_stackable(handler_type, args.to_h { |arg| [arg, handler] })
|
129
129
|
end
|
130
130
|
|
131
131
|
namespace_stackable(:rescue_options, options)
|
data/lib/grape/endpoint.rb
CHANGED
@@ -299,7 +299,7 @@ module Grape
|
|
299
299
|
|
300
300
|
if namespace_inheritable(:version)
|
301
301
|
stack.use Grape::Middleware::Versioner.using(namespace_inheritable(:version_options)[:using]),
|
302
|
-
versions: namespace_inheritable(:version)
|
302
|
+
versions: namespace_inheritable(:version)&.flatten,
|
303
303
|
version_options: namespace_inheritable(:version_options),
|
304
304
|
prefix: namespace_inheritable(:root_prefix),
|
305
305
|
mount_path: namespace_stackable(:mount_path).first
|
@@ -325,7 +325,7 @@ module Grape
|
|
325
325
|
private :build_stack, :build_helpers
|
326
326
|
|
327
327
|
def execute
|
328
|
-
@block
|
328
|
+
@block&.call(self)
|
329
329
|
end
|
330
330
|
|
331
331
|
def helpers
|
@@ -95,7 +95,7 @@ module Grape
|
|
95
95
|
|
96
96
|
# @return [Rack::Builder] the builder object with our middlewares applied
|
97
97
|
def build(builder = Rack::Builder.new)
|
98
|
-
others.shift(others.size).each(
|
98
|
+
others.shift(others.size).each { |m| merge_with(m) }
|
99
99
|
middlewares.each do |m|
|
100
100
|
m.use_in(builder)
|
101
101
|
end
|
data/lib/grape/request.rb
CHANGED
data/lib/grape/util/cache.rb
CHANGED
@@ -485,7 +485,7 @@ module Grape
|
|
485
485
|
values_list.each do |values|
|
486
486
|
next if !values || values.is_a?(Proc)
|
487
487
|
|
488
|
-
value_types = values.is_a?(Range) ? [values.begin, values.end] : values
|
488
|
+
value_types = values.is_a?(Range) ? [values.begin, values.end].compact : values
|
489
489
|
value_types = value_types.map { |type| Grape::API::Boolean.build(type) } if coerce_type == Grape::API::Boolean
|
490
490
|
raise Grape::Exceptions::IncompatibleOptionValues.new(:type, coerce_type, :values, values) unless value_types.all?(coerce_type)
|
491
491
|
end
|
data/lib/grape/version.rb
CHANGED
data/lib/grape.rb
CHANGED
data/spec/grape/api_spec.rb
CHANGED
@@ -103,22 +103,6 @@ describe Grape::API do
|
|
103
103
|
}
|
104
104
|
end
|
105
105
|
end
|
106
|
-
|
107
|
-
# Behavior as defined by rfc2616 when no header is defined
|
108
|
-
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
|
109
|
-
describe 'no specified accept header' do
|
110
|
-
# subject.version 'v1', using: :header
|
111
|
-
# subject.get '/hello' do
|
112
|
-
# 'hello'
|
113
|
-
# end
|
114
|
-
|
115
|
-
# it 'routes' do
|
116
|
-
# get '/hello'
|
117
|
-
# last_response.status.should eql 200
|
118
|
-
# end
|
119
|
-
end
|
120
|
-
|
121
|
-
# pending 'routes if any media type is allowed'
|
122
106
|
end
|
123
107
|
|
124
108
|
describe '.version using accept_version_header' do
|
@@ -448,9 +432,10 @@ describe Grape::API do
|
|
448
432
|
expect(last_response.body).to eql 'hiya'
|
449
433
|
end
|
450
434
|
|
435
|
+
objects = ['string', :symbol, 1, -1.1, {}, [], true, false, nil].freeze
|
451
436
|
%i[put post].each do |verb|
|
452
437
|
context verb.to_s do
|
453
|
-
|
438
|
+
objects.each do |object|
|
454
439
|
it "allows a(n) #{object.class} json object in params" do
|
455
440
|
subject.format :json
|
456
441
|
subject.send(verb) do
|
@@ -1601,7 +1586,7 @@ describe Grape::API do
|
|
1601
1586
|
|
1602
1587
|
subject.get(:hello) { 'Hello, world.' }
|
1603
1588
|
get '/hello', {}, 'HTTP_AUTHORIZATION' => encode_basic_auth('allow', 'whatever')
|
1604
|
-
expect(basic_auth_context).to
|
1589
|
+
expect(basic_auth_context).to be_a(Grape::Endpoint)
|
1605
1590
|
end
|
1606
1591
|
|
1607
1592
|
it 'has access to helper methods' do
|
@@ -3067,7 +3052,7 @@ describe Grape::API do
|
|
3067
3052
|
expect(route.description).to eq('first method')
|
3068
3053
|
expect(route.route_foo).to be_nil
|
3069
3054
|
expect(route.params).to eq({})
|
3070
|
-
expect(route.options).to
|
3055
|
+
expect(route.options).to be_a(Hash)
|
3071
3056
|
end
|
3072
3057
|
|
3073
3058
|
it 'has params which does not include format and version as named captures' do
|
@@ -3725,7 +3710,7 @@ describe Grape::API do
|
|
3725
3710
|
it 'sets the instance' do
|
3726
3711
|
expect(subject.instance).to be_nil
|
3727
3712
|
subject.compile
|
3728
|
-
expect(subject.instance).to
|
3713
|
+
expect(subject.instance).to be_a(subject.base_instance)
|
3729
3714
|
end
|
3730
3715
|
end
|
3731
3716
|
|
data/spec/grape/dsl/desc_spec.rb
CHANGED
@@ -26,6 +26,7 @@ module Grape
|
|
26
26
|
detail: 'more details',
|
27
27
|
params: { first: :param },
|
28
28
|
entity: Object,
|
29
|
+
default: { code: 400, message: 'Invalid' },
|
29
30
|
http_codes: [[401, 'Unauthorized', 'Entities::Error']],
|
30
31
|
named: 'My named route',
|
31
32
|
body_name: 'My body name',
|
@@ -54,6 +55,7 @@ module Grape
|
|
54
55
|
detail 'more details'
|
55
56
|
params(first: :param)
|
56
57
|
success Object
|
58
|
+
default code: 400, message: 'Invalid'
|
57
59
|
failure [[401, 'Unauthorized', 'Entities::Error']]
|
58
60
|
named 'My named route'
|
59
61
|
body_name 'My body name'
|
data/spec/grape/endpoint_spec.rb
CHANGED
@@ -75,7 +75,7 @@ describe Grape::Endpoint do
|
|
75
75
|
it 'sets itself in the env upon call' do
|
76
76
|
subject.get('/') { 'Hello world.' }
|
77
77
|
get '/'
|
78
|
-
expect(last_request.env['api.endpoint']).to
|
78
|
+
expect(last_request.env['api.endpoint']).to be_a(described_class)
|
79
79
|
end
|
80
80
|
|
81
81
|
describe '#status' do
|
@@ -140,7 +140,8 @@ describe Grape::Endpoint do
|
|
140
140
|
get '/headers'
|
141
141
|
expect(JSON.parse(last_response.body)).to eq(
|
142
142
|
'Host' => 'example.org',
|
143
|
-
'Cookie' => ''
|
143
|
+
'Cookie' => '',
|
144
|
+
'Version' => 'HTTP/1.0'
|
144
145
|
)
|
145
146
|
end
|
146
147
|
|
@@ -213,10 +214,10 @@ describe Grape::Endpoint do
|
|
213
214
|
end
|
214
215
|
get '/test', {}, 'HTTP_COOKIE' => 'delete_this_cookie=1; and_this=2'
|
215
216
|
expect(last_response.body).to eq('3')
|
216
|
-
cookies = last_response.headers['Set-Cookie'].split("\n").
|
217
|
+
cookies = last_response.headers['Set-Cookie'].split("\n").to_h do |set_cookie|
|
217
218
|
cookie = CookieJar::Cookie.from_set_cookie 'http://localhost/test', set_cookie
|
218
219
|
[cookie.name, cookie]
|
219
|
-
end
|
220
|
+
end
|
220
221
|
expect(cookies.size).to eq(2)
|
221
222
|
%w[and_this delete_this_cookie].each do |cookie_name|
|
222
223
|
cookie = cookies[cookie_name]
|
@@ -237,10 +238,10 @@ describe Grape::Endpoint do
|
|
237
238
|
end
|
238
239
|
get('/test', {}, 'HTTP_COOKIE' => 'delete_this_cookie=1; and_this=2')
|
239
240
|
expect(last_response.body).to eq('3')
|
240
|
-
cookies = last_response.headers['Set-Cookie'].split("\n").
|
241
|
+
cookies = last_response.headers['Set-Cookie'].split("\n").to_h do |set_cookie|
|
241
242
|
cookie = CookieJar::Cookie.from_set_cookie 'http://localhost/test', set_cookie
|
242
243
|
[cookie.name, cookie]
|
243
|
-
end
|
244
|
+
end
|
244
245
|
expect(cookies.size).to eq(2)
|
245
246
|
%w[and_this delete_this_cookie].each do |cookie_name|
|
246
247
|
cookie = cookies[cookie_name]
|
@@ -432,7 +433,7 @@ describe Grape::Endpoint do
|
|
432
433
|
end
|
433
434
|
post '/upload', { file: '' }, 'CONTENT_TYPE' => 'multipart/form-data; boundary=foobar'
|
434
435
|
expect(last_response.status).to eq(400)
|
435
|
-
expect(last_response.body).to eq('
|
436
|
+
expect(last_response.body).to eq('file is invalid')
|
436
437
|
end
|
437
438
|
end
|
438
439
|
|
@@ -10,11 +10,13 @@ describe Grape::Exceptions::InvalidAcceptHeader do
|
|
10
10
|
expect(last_response.body).to eq('beer received')
|
11
11
|
end
|
12
12
|
end
|
13
|
+
|
13
14
|
shared_examples_for 'a cascaded request' do
|
14
15
|
it 'does not find a matching route' do
|
15
16
|
expect(last_response.status).to eq 404
|
16
17
|
end
|
17
18
|
end
|
19
|
+
|
18
20
|
shared_examples_for 'a not-cascaded request' do
|
19
21
|
it 'does not include the X-Cascade=pass header' do
|
20
22
|
expect(last_response.headers['X-Cascade']).to be_nil
|
@@ -24,6 +26,7 @@ describe Grape::Exceptions::InvalidAcceptHeader do
|
|
24
26
|
expect(last_response.status).to eq 406
|
25
27
|
end
|
26
28
|
end
|
29
|
+
|
27
30
|
shared_examples_for 'a rescued request' do
|
28
31
|
it 'does not include the X-Cascade=pass header' do
|
29
32
|
expect(last_response.headers['X-Cascade']).to be_nil
|
@@ -27,19 +27,20 @@ describe Rack do
|
|
27
27
|
end
|
28
28
|
|
29
29
|
context 'when the app is mounted' do
|
30
|
-
|
31
|
-
|
30
|
+
let(:ping_mount) do
|
31
|
+
Class.new(Grape::API) do
|
32
32
|
get 'ping'
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
let
|
37
|
-
app_to_mount =
|
38
|
-
Class.new(Grape::API) do
|
36
|
+
let(:app) do
|
37
|
+
app_to_mount = ping_mount
|
38
|
+
app = Class.new(Grape::API) do
|
39
39
|
namespace 'namespace' do
|
40
40
|
mount app_to_mount
|
41
41
|
end
|
42
42
|
end
|
43
|
+
Rack::Builder.new(app)
|
43
44
|
end
|
44
45
|
|
45
46
|
it 'finds the app on the namespace' do
|
@@ -70,18 +70,18 @@ describe Grape::Middleware::Base do
|
|
70
70
|
|
71
71
|
it 'is able to access the response' do
|
72
72
|
subject.call({})
|
73
|
-
expect(subject.response).to
|
73
|
+
expect(subject.response).to be_a(Rack::Response)
|
74
74
|
end
|
75
75
|
|
76
76
|
describe '#response' do
|
77
77
|
subject do
|
78
|
-
puts described_class
|
79
78
|
described_class.new(response)
|
80
79
|
end
|
81
80
|
|
82
81
|
before { subject.call({}) }
|
83
82
|
|
84
83
|
context 'when Array' do
|
84
|
+
let(:rack_response) { Rack::Response.new('test', 204, abc: 1) }
|
85
85
|
let(:response) { ->(_) { [204, { abc: 1 }, 'test'] } }
|
86
86
|
|
87
87
|
it 'status' do
|
@@ -97,12 +97,14 @@ describe Grape::Middleware::Base do
|
|
97
97
|
end
|
98
98
|
|
99
99
|
it 'returns the memoized Rack::Response instance' do
|
100
|
-
|
100
|
+
allow(Rack::Response).to receive(:new).and_return(rack_response)
|
101
|
+
expect(subject.response).to eq(rack_response)
|
101
102
|
end
|
102
103
|
end
|
103
104
|
|
104
105
|
context 'when Rack::Response' do
|
105
|
-
let(:
|
106
|
+
let(:rack_response) { Rack::Response.new('test', 204, abc: 1) }
|
107
|
+
let(:response) { ->(_) { rack_response } }
|
106
108
|
|
107
109
|
it 'status' do
|
108
110
|
expect(subject.response.status).to eq(204)
|
@@ -117,7 +119,7 @@ describe Grape::Middleware::Base do
|
|
117
119
|
end
|
118
120
|
|
119
121
|
it 'returns the memoized Rack::Response instance' do
|
120
|
-
expect(subject.response).to
|
122
|
+
expect(subject.response).to eq(rack_response)
|
121
123
|
end
|
122
124
|
end
|
123
125
|
end
|
@@ -13,7 +13,7 @@ describe Grape::Middleware::Formatter do
|
|
13
13
|
|
14
14
|
it 'looks at the bodies for possibly serializable data' do
|
15
15
|
_, _, bodies = *subject.call('PATH_INFO' => '/somewhere', 'HTTP_ACCEPT' => 'application/json')
|
16
|
-
bodies.each { |b| expect(b).to eq(::Grape::Json.dump(body)) }
|
16
|
+
bodies.each { |b| expect(b).to eq(::Grape::Json.dump(body)) } # rubocop:disable RSpec/IteratedExpectation
|
17
17
|
end
|
18
18
|
|
19
19
|
context 'default format' do
|
@@ -26,7 +26,7 @@ describe Grape::Middleware::Formatter do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
subject.call('PATH_INFO' => '/somewhere', 'HTTP_ACCEPT' => 'application/json').to_a.last.each { |b| expect(b).to eq('"bar"') }
|
29
|
+
subject.call('PATH_INFO' => '/somewhere', 'HTTP_ACCEPT' => 'application/json').to_a.last.each { |b| expect(b).to eq('"bar"') } # rubocop:disable RSpec/IteratedExpectation
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -40,7 +40,7 @@ describe Grape::Middleware::Formatter do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
subject.call('PATH_INFO' => '/somewhere', 'HTTP_ACCEPT' => 'application/vnd.api+json').to_a.last.each { |b| expect(b).to eq('{"foos":[{"bar":"baz"}] }') }
|
43
|
+
subject.call('PATH_INFO' => '/somewhere', 'HTTP_ACCEPT' => 'application/vnd.api+json').to_a.last.each { |b| expect(b).to eq('{"foos":[{"bar":"baz"}] }') } # rubocop:disable RSpec/IteratedExpectation
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -53,8 +53,7 @@ describe Grape::Middleware::Formatter do
|
|
53
53
|
'<bar/>'
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
57
|
-
subject.call('PATH_INFO' => '/somewhere.xml', 'HTTP_ACCEPT' => 'application/json').to_a.last.each { |b| expect(b).to eq('<bar/>') }
|
56
|
+
subject.call('PATH_INFO' => '/somewhere.xml', 'HTTP_ACCEPT' => 'application/json').to_a.last.each { |b| expect(b).to eq('<bar/>') } # rubocop:disable RSpec/IteratedExpectation
|
58
57
|
end
|
59
58
|
end
|
60
59
|
end
|
@@ -243,6 +242,7 @@ describe Grape::Middleware::Formatter do
|
|
243
242
|
end
|
244
243
|
|
245
244
|
context 'input' do
|
245
|
+
content_types = ['application/json', 'application/json; charset=utf-8'].freeze
|
246
246
|
%w[POST PATCH PUT DELETE].each do |method|
|
247
247
|
context 'when body is not nil or empty' do
|
248
248
|
context 'when Content-Type is supported' do
|
@@ -320,7 +320,7 @@ describe Grape::Middleware::Formatter do
|
|
320
320
|
end
|
321
321
|
end
|
322
322
|
|
323
|
-
|
323
|
+
content_types.each do |content_type|
|
324
324
|
context content_type do
|
325
325
|
it "parses the body from #{method} and copies values into rack.request.form_hash" do
|
326
326
|
io = StringIO.new('{"is_boolean":true,"string":"thing"}')
|
@@ -114,6 +114,13 @@ describe Grape::Validations::Validators::ValuesValidator do
|
|
114
114
|
{ type: params[:type] }
|
115
115
|
end
|
116
116
|
|
117
|
+
params do
|
118
|
+
optional :type, type: Integer, values: 1..
|
119
|
+
end
|
120
|
+
get '/endless' do
|
121
|
+
{ type: params[:type] }
|
122
|
+
end
|
123
|
+
|
117
124
|
params do
|
118
125
|
requires :type, values: ->(v) { ValuesModel.include? v }
|
119
126
|
end
|
@@ -374,6 +381,18 @@ describe Grape::Validations::Validators::ValuesValidator do
|
|
374
381
|
expect(last_response.body).to eq({ error: 'type does not have a valid value' }.to_json)
|
375
382
|
end
|
376
383
|
|
384
|
+
it 'validates against values in an endless range', if: ActiveSupport::VERSION::MAJOR >= 6 do
|
385
|
+
get('/endless', type: 10)
|
386
|
+
expect(last_response.status).to eq 200
|
387
|
+
expect(last_response.body).to eq({ type: 10 }.to_json)
|
388
|
+
end
|
389
|
+
|
390
|
+
it 'does not allow an invalid value for a parameter using an endless range', if: ActiveSupport::VERSION::MAJOR >= 6 do
|
391
|
+
get('/endless', type: 0)
|
392
|
+
expect(last_response.status).to eq 400
|
393
|
+
expect(last_response.body).to eq({ error: 'type does not have a valid value' }.to_json)
|
394
|
+
end
|
395
|
+
|
377
396
|
it 'does not allow non-numeric string value for int value using lambda' do
|
378
397
|
get('/lambda_int_val', number: 'foo')
|
379
398
|
expect(last_response.status).to eq 400
|
@@ -1071,12 +1071,12 @@ describe Grape::Validations do
|
|
1071
1071
|
}
|
1072
1072
|
# debugger
|
1073
1073
|
get '/multi_level', data
|
1074
|
-
expect(last_response.body.split(', ')).to
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1074
|
+
expect(last_response.body.split(', ')).to contain_exactly(
|
1075
|
+
'top[3][top_id] is empty',
|
1076
|
+
'top[2][middle_1][0][middle_1_id] is empty',
|
1077
|
+
'top[1][middle_1][1][middle_2][0][middle_2_id] is empty',
|
1078
|
+
'top[0][middle_1][1][middle_2][1][bottom][0][bottom_id] is empty'
|
1079
|
+
)
|
1080
1080
|
expect(last_response.status).to eq(400)
|
1081
1081
|
end
|
1082
1082
|
end
|
@@ -1509,6 +1509,29 @@ describe Grape::Validations do
|
|
1509
1509
|
end
|
1510
1510
|
end
|
1511
1511
|
|
1512
|
+
context 'with block and empty args' do
|
1513
|
+
before do
|
1514
|
+
subject.helpers do
|
1515
|
+
params :shared_params do |empty_args|
|
1516
|
+
optional :param, default: empty_args[:some]
|
1517
|
+
end
|
1518
|
+
end
|
1519
|
+
subject.format :json
|
1520
|
+
subject.params do
|
1521
|
+
use :shared_params
|
1522
|
+
end
|
1523
|
+
subject.get '/shared_params' do
|
1524
|
+
:ok
|
1525
|
+
end
|
1526
|
+
end
|
1527
|
+
|
1528
|
+
it 'works' do
|
1529
|
+
get '/shared_params'
|
1530
|
+
|
1531
|
+
expect(last_response.status).to eq(200)
|
1532
|
+
end
|
1533
|
+
end
|
1534
|
+
|
1512
1535
|
context 'all or none' do
|
1513
1536
|
context 'optional params' do
|
1514
1537
|
before do
|
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.7.
|
4
|
+
version: 1.7.1
|
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: 2023-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -73,6 +73,9 @@ dependencies:
|
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 1.3.0
|
76
|
+
- - "<"
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '3'
|
76
79
|
type: :runtime
|
77
80
|
prerelease: false
|
78
81
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -80,6 +83,9 @@ dependencies:
|
|
80
83
|
- - ">="
|
81
84
|
- !ruby/object:Gem::Version
|
82
85
|
version: 1.3.0
|
86
|
+
- - "<"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '3'
|
83
89
|
- !ruby/object:Gem::Dependency
|
84
90
|
name: rack-accept
|
85
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -203,6 +209,7 @@ files:
|
|
203
209
|
- lib/grape/serve_stream/file_body.rb
|
204
210
|
- lib/grape/serve_stream/sendfile_response.rb
|
205
211
|
- lib/grape/serve_stream/stream_response.rb
|
212
|
+
- lib/grape/types/invalid_value.rb
|
206
213
|
- lib/grape/util/base_inheritable.rb
|
207
214
|
- lib/grape/util/cache.rb
|
208
215
|
- lib/grape/util/endpoint_configuration.rb
|
@@ -276,7 +283,6 @@ files:
|
|
276
283
|
- spec/grape/api_spec.rb
|
277
284
|
- spec/grape/config_spec.rb
|
278
285
|
- spec/grape/dsl/callbacks_spec.rb
|
279
|
-
- spec/grape/dsl/configuration_spec.rb
|
280
286
|
- spec/grape/dsl/desc_spec.rb
|
281
287
|
- spec/grape/dsl/headers_spec.rb
|
282
288
|
- spec/grape/dsl/helpers_spec.rb
|
@@ -337,7 +343,6 @@ files:
|
|
337
343
|
- spec/grape/util/stackable_values_spec.rb
|
338
344
|
- spec/grape/util/strict_hash_configuration_spec.rb
|
339
345
|
- spec/grape/validations/attributes_doc_spec.rb
|
340
|
-
- spec/grape/validations/attributes_iterator_spec.rb
|
341
346
|
- spec/grape/validations/instance_behaivour_spec.rb
|
342
347
|
- spec/grape/validations/multiple_attributes_iterator_spec.rb
|
343
348
|
- spec/grape/validations/params_scope_spec.rb
|
@@ -377,10 +382,10 @@ licenses:
|
|
377
382
|
- MIT
|
378
383
|
metadata:
|
379
384
|
bug_tracker_uri: https://github.com/ruby-grape/grape/issues
|
380
|
-
changelog_uri: https://github.com/ruby-grape/grape/blob/v1.7.
|
381
|
-
documentation_uri: https://www.rubydoc.info/gems/grape/1.7.
|
382
|
-
source_code_uri: https://github.com/ruby-grape/grape/tree/v1.7.
|
383
|
-
post_install_message:
|
385
|
+
changelog_uri: https://github.com/ruby-grape/grape/blob/v1.7.1/CHANGELOG.md
|
386
|
+
documentation_uri: https://www.rubydoc.info/gems/grape/1.7.1
|
387
|
+
source_code_uri: https://github.com/ruby-grape/grape/tree/v1.7.1
|
388
|
+
post_install_message:
|
384
389
|
rdoc_options: []
|
385
390
|
require_paths:
|
386
391
|
- lib
|
@@ -388,133 +393,131 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
388
393
|
requirements:
|
389
394
|
- - ">="
|
390
395
|
- !ruby/object:Gem::Version
|
391
|
-
version: 2.
|
396
|
+
version: 2.6.0
|
392
397
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
393
398
|
requirements:
|
394
399
|
- - ">="
|
395
400
|
- !ruby/object:Gem::Version
|
396
401
|
version: '0'
|
397
402
|
requirements: []
|
398
|
-
rubygems_version: 3.3
|
399
|
-
signing_key:
|
403
|
+
rubygems_version: 3.0.3
|
404
|
+
signing_key:
|
400
405
|
specification_version: 4
|
401
406
|
summary: A simple Ruby framework for building REST-like APIs.
|
402
407
|
test_files:
|
403
|
-
- spec/
|
404
|
-
- spec/
|
405
|
-
- spec/
|
406
|
-
- spec/
|
407
|
-
- spec/
|
408
|
-
- spec/
|
409
|
-
- spec/
|
410
|
-
- spec/
|
411
|
-
- spec/
|
412
|
-
- spec/
|
413
|
-
- spec/
|
414
|
-
- spec/
|
415
|
-
- spec/grape/api/recognize_path_spec.rb
|
416
|
-
- spec/grape/api/required_parameters_in_route_spec.rb
|
417
|
-
- spec/grape/api/required_parameters_with_invalid_method_spec.rb
|
418
|
-
- spec/grape/api/routes_with_requirements_spec.rb
|
419
|
-
- spec/grape/api/shared_helpers_exactly_one_of_spec.rb
|
420
|
-
- spec/grape/api/shared_helpers_spec.rb
|
421
|
-
- spec/grape/api_remount_spec.rb
|
422
|
-
- spec/grape/api_spec.rb
|
423
|
-
- spec/grape/config_spec.rb
|
424
|
-
- spec/grape/dsl/callbacks_spec.rb
|
425
|
-
- spec/grape/dsl/configuration_spec.rb
|
426
|
-
- spec/grape/dsl/desc_spec.rb
|
427
|
-
- spec/grape/dsl/headers_spec.rb
|
428
|
-
- spec/grape/dsl/helpers_spec.rb
|
429
|
-
- spec/grape/dsl/inside_route_spec.rb
|
430
|
-
- spec/grape/dsl/logger_spec.rb
|
431
|
-
- spec/grape/dsl/middleware_spec.rb
|
432
|
-
- spec/grape/dsl/parameters_spec.rb
|
433
|
-
- spec/grape/dsl/request_response_spec.rb
|
434
|
-
- spec/grape/dsl/routing_spec.rb
|
435
|
-
- spec/grape/dsl/settings_spec.rb
|
436
|
-
- spec/grape/dsl/validations_spec.rb
|
437
|
-
- spec/grape/endpoint/declared_spec.rb
|
438
|
-
- spec/grape/endpoint_spec.rb
|
439
|
-
- spec/grape/entity_spec.rb
|
440
|
-
- spec/grape/exceptions/base_spec.rb
|
441
|
-
- spec/grape/exceptions/body_parse_errors_spec.rb
|
442
|
-
- spec/grape/exceptions/invalid_accept_header_spec.rb
|
443
|
-
- spec/grape/exceptions/invalid_formatter_spec.rb
|
444
|
-
- spec/grape/exceptions/invalid_response_spec.rb
|
445
|
-
- spec/grape/exceptions/invalid_versioner_option_spec.rb
|
446
|
-
- spec/grape/exceptions/missing_group_type_spec.rb
|
447
|
-
- spec/grape/exceptions/missing_mime_type_spec.rb
|
448
|
-
- spec/grape/exceptions/missing_option_spec.rb
|
449
|
-
- spec/grape/exceptions/unknown_options_spec.rb
|
450
|
-
- spec/grape/exceptions/unknown_validator_spec.rb
|
451
|
-
- spec/grape/exceptions/unsupported_group_type_spec.rb
|
452
|
-
- spec/grape/exceptions/validation_errors_spec.rb
|
453
|
-
- spec/grape/exceptions/validation_spec.rb
|
454
|
-
- spec/grape/extensions/param_builders/hash_spec.rb
|
455
|
-
- spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb
|
456
|
-
- spec/grape/extensions/param_builders/hashie/mash_spec.rb
|
457
|
-
- spec/grape/integration/global_namespace_function_spec.rb
|
458
|
-
- spec/grape/integration/rack_sendfile_spec.rb
|
459
|
-
- spec/grape/integration/rack_spec.rb
|
460
|
-
- spec/grape/loading_spec.rb
|
461
|
-
- spec/grape/middleware/auth/base_spec.rb
|
462
|
-
- spec/grape/middleware/auth/dsl_spec.rb
|
463
|
-
- spec/grape/middleware/auth/strategies_spec.rb
|
464
|
-
- spec/grape/middleware/base_spec.rb
|
408
|
+
- spec/spec_helper.rb
|
409
|
+
- spec/integration/eager_load/eager_load_spec.rb
|
410
|
+
- spec/integration/multi_xml/xml_spec.rb
|
411
|
+
- spec/integration/multi_json/json_spec.rb
|
412
|
+
- spec/shared/versioning_examples.rb
|
413
|
+
- spec/support/basic_auth_encode_helpers.rb
|
414
|
+
- spec/support/endpoint_faker.rb
|
415
|
+
- spec/support/chunks.rb
|
416
|
+
- spec/support/file_streamer.rb
|
417
|
+
- spec/support/versioned_helpers.rb
|
418
|
+
- spec/support/content_type_helpers.rb
|
419
|
+
- spec/support/integer_helpers.rb
|
465
420
|
- spec/grape/middleware/error_spec.rb
|
466
|
-
- spec/grape/middleware/exception_spec.rb
|
467
|
-
- spec/grape/middleware/formatter_spec.rb
|
468
421
|
- spec/grape/middleware/globals_spec.rb
|
422
|
+
- spec/grape/middleware/formatter_spec.rb
|
423
|
+
- spec/grape/middleware/auth/strategies_spec.rb
|
424
|
+
- spec/grape/middleware/auth/dsl_spec.rb
|
425
|
+
- spec/grape/middleware/auth/base_spec.rb
|
469
426
|
- spec/grape/middleware/stack_spec.rb
|
427
|
+
- spec/grape/middleware/exception_spec.rb
|
428
|
+
- spec/grape/middleware/versioner_spec.rb
|
470
429
|
- spec/grape/middleware/versioner/accept_version_header_spec.rb
|
471
430
|
- spec/grape/middleware/versioner/header_spec.rb
|
472
|
-
- spec/grape/middleware/versioner/param_spec.rb
|
473
431
|
- spec/grape/middleware/versioner/path_spec.rb
|
474
|
-
- spec/grape/middleware/
|
475
|
-
- spec/grape/
|
476
|
-
- spec/grape/
|
477
|
-
- spec/grape/
|
478
|
-
- spec/grape/
|
479
|
-
- spec/grape/
|
480
|
-
- spec/grape/util/inheritable_setting_spec.rb
|
481
|
-
- spec/grape/util/inheritable_values_spec.rb
|
432
|
+
- spec/grape/middleware/versioner/param_spec.rb
|
433
|
+
- spec/grape/middleware/base_spec.rb
|
434
|
+
- spec/grape/config_spec.rb
|
435
|
+
- spec/grape/loading_spec.rb
|
436
|
+
- spec/grape/endpoint_spec.rb
|
437
|
+
- spec/grape/api_spec.rb
|
482
438
|
- spec/grape/util/reverse_stackable_values_spec.rb
|
483
439
|
- spec/grape/util/stackable_values_spec.rb
|
440
|
+
- spec/grape/util/inheritable_setting_spec.rb
|
484
441
|
- spec/grape/util/strict_hash_configuration_spec.rb
|
485
|
-
- spec/grape/
|
486
|
-
- spec/grape/
|
487
|
-
- spec/grape/
|
488
|
-
- spec/grape/
|
489
|
-
- spec/grape/
|
442
|
+
- spec/grape/util/inheritable_values_spec.rb
|
443
|
+
- spec/grape/integration/rack_spec.rb
|
444
|
+
- spec/grape/integration/rack_sendfile_spec.rb
|
445
|
+
- spec/grape/integration/global_namespace_function_spec.rb
|
446
|
+
- spec/grape/validations_spec.rb
|
447
|
+
- spec/grape/entity_spec.rb
|
448
|
+
- spec/grape/exceptions/missing_group_type_spec.rb
|
449
|
+
- spec/grape/exceptions/unsupported_group_type_spec.rb
|
450
|
+
- spec/grape/exceptions/validation_spec.rb
|
451
|
+
- spec/grape/exceptions/invalid_accept_header_spec.rb
|
452
|
+
- spec/grape/exceptions/missing_option_spec.rb
|
453
|
+
- spec/grape/exceptions/invalid_response_spec.rb
|
454
|
+
- spec/grape/exceptions/body_parse_errors_spec.rb
|
455
|
+
- spec/grape/exceptions/invalid_formatter_spec.rb
|
456
|
+
- spec/grape/exceptions/missing_mime_type_spec.rb
|
457
|
+
- spec/grape/exceptions/unknown_options_spec.rb
|
458
|
+
- spec/grape/exceptions/validation_errors_spec.rb
|
459
|
+
- spec/grape/exceptions/unknown_validator_spec.rb
|
460
|
+
- spec/grape/exceptions/invalid_versioner_option_spec.rb
|
461
|
+
- spec/grape/exceptions/base_spec.rb
|
462
|
+
- spec/grape/presenters/presenter_spec.rb
|
490
463
|
- spec/grape/validations/single_attribute_iterator_spec.rb
|
491
|
-
- spec/grape/validations/types/array_coercer_spec.rb
|
492
464
|
- spec/grape/validations/types/primitive_coercer_spec.rb
|
493
465
|
- spec/grape/validations/types/set_coercer_spec.rb
|
466
|
+
- spec/grape/validations/types/array_coercer_spec.rb
|
467
|
+
- spec/grape/validations/attributes_doc_spec.rb
|
468
|
+
- spec/grape/validations/params_scope_spec.rb
|
469
|
+
- spec/grape/validations/instance_behaivour_spec.rb
|
470
|
+
- spec/grape/validations/multiple_attributes_iterator_spec.rb
|
494
471
|
- spec/grape/validations/types_spec.rb
|
495
|
-
- spec/grape/validations/validators/
|
496
|
-
- spec/grape/validations/validators/
|
497
|
-
- spec/grape/validations/validators/at_least_one_of_spec.rb
|
498
|
-
- spec/grape/validations/validators/coerce_spec.rb
|
499
|
-
- spec/grape/validations/validators/default_spec.rb
|
472
|
+
- spec/grape/validations/validators/regexp_spec.rb
|
473
|
+
- spec/grape/validations/validators/mutual_exclusion_spec.rb
|
500
474
|
- spec/grape/validations/validators/exactly_one_of_spec.rb
|
501
475
|
- spec/grape/validations/validators/except_values_spec.rb
|
502
|
-
- spec/grape/validations/validators/mutual_exclusion_spec.rb
|
503
476
|
- spec/grape/validations/validators/presence_spec.rb
|
504
|
-
- spec/grape/validations/validators/
|
477
|
+
- spec/grape/validations/validators/all_or_none_spec.rb
|
478
|
+
- spec/grape/validations/validators/allow_blank_spec.rb
|
505
479
|
- spec/grape/validations/validators/same_as_spec.rb
|
480
|
+
- spec/grape/validations/validators/default_spec.rb
|
506
481
|
- spec/grape/validations/validators/values_spec.rb
|
482
|
+
- spec/grape/validations/validators/at_least_one_of_spec.rb
|
483
|
+
- spec/grape/validations/validators/coerce_spec.rb
|
507
484
|
- spec/grape/validations/validators/zh-CN.yml
|
508
|
-
- spec/grape/
|
509
|
-
- spec/
|
510
|
-
- spec/
|
511
|
-
- spec/
|
512
|
-
- spec/
|
513
|
-
- spec/
|
514
|
-
- spec/
|
515
|
-
- spec/
|
516
|
-
- spec/
|
517
|
-
- spec/
|
518
|
-
- spec/
|
519
|
-
- spec/
|
520
|
-
- spec/
|
485
|
+
- spec/grape/extensions/param_builders/hashie/mash_spec.rb
|
486
|
+
- spec/grape/extensions/param_builders/hash_spec.rb
|
487
|
+
- spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb
|
488
|
+
- spec/grape/parser_spec.rb
|
489
|
+
- spec/grape/request_spec.rb
|
490
|
+
- spec/grape/endpoint/declared_spec.rb
|
491
|
+
- spec/grape/api/parameters_modification_spec.rb
|
492
|
+
- spec/grape/api/patch_method_helpers_spec.rb
|
493
|
+
- spec/grape/api/required_parameters_with_invalid_method_spec.rb
|
494
|
+
- spec/grape/api/nested_helpers_spec.rb
|
495
|
+
- spec/grape/api/defines_boolean_in_params_spec.rb
|
496
|
+
- spec/grape/api/invalid_format_spec.rb
|
497
|
+
- spec/grape/api/required_parameters_in_route_spec.rb
|
498
|
+
- spec/grape/api/instance_spec.rb
|
499
|
+
- spec/grape/api/namespace_parameters_in_route_spec.rb
|
500
|
+
- spec/grape/api/recognize_path_spec.rb
|
501
|
+
- spec/grape/api/shared_helpers_exactly_one_of_spec.rb
|
502
|
+
- spec/grape/api/inherited_helpers_spec.rb
|
503
|
+
- spec/grape/api/shared_helpers_spec.rb
|
504
|
+
- spec/grape/api/deeply_included_options_spec.rb
|
505
|
+
- spec/grape/api/routes_with_requirements_spec.rb
|
506
|
+
- spec/grape/api/custom_validations_spec.rb
|
507
|
+
- spec/grape/api/optional_parameters_in_route_spec.rb
|
508
|
+
- spec/grape/api/documentation_spec.rb
|
509
|
+
- spec/grape/api_remount_spec.rb
|
510
|
+
- spec/grape/named_api_spec.rb
|
511
|
+
- spec/grape/dsl/request_response_spec.rb
|
512
|
+
- spec/grape/dsl/desc_spec.rb
|
513
|
+
- spec/grape/dsl/logger_spec.rb
|
514
|
+
- spec/grape/dsl/validations_spec.rb
|
515
|
+
- spec/grape/dsl/parameters_spec.rb
|
516
|
+
- spec/grape/dsl/helpers_spec.rb
|
517
|
+
- spec/grape/dsl/middleware_spec.rb
|
518
|
+
- spec/grape/dsl/headers_spec.rb
|
519
|
+
- spec/grape/dsl/callbacks_spec.rb
|
520
|
+
- spec/grape/dsl/settings_spec.rb
|
521
|
+
- spec/grape/dsl/routing_spec.rb
|
522
|
+
- spec/grape/dsl/inside_route_spec.rb
|
523
|
+
- spec/grape/path_spec.rb
|