grape 1.6.2 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +54 -1
- data/CONTRIBUTING.md +30 -0
- data/README.md +146 -23
- data/UPGRADING.md +15 -0
- data/grape.gemspec +2 -2
- data/lib/grape/api/instance.rb +1 -1
- data/lib/grape/dry_types.rb +12 -0
- data/lib/grape/dsl/api.rb +0 -2
- data/lib/grape/dsl/callbacks.rb +0 -2
- data/lib/grape/dsl/configuration.rb +0 -2
- data/lib/grape/dsl/desc.rb +2 -16
- data/lib/grape/dsl/helpers.rb +0 -2
- data/lib/grape/dsl/inside_route.rb +34 -30
- data/lib/grape/dsl/middleware.rb +0 -2
- data/lib/grape/dsl/parameters.rb +10 -7
- data/lib/grape/dsl/request_response.rb +1 -3
- data/lib/grape/dsl/routing.rb +4 -2
- data/lib/grape/dsl/settings.rb +0 -2
- data/lib/grape/dsl/validations.rb +0 -15
- data/lib/grape/endpoint.rb +2 -2
- data/lib/grape/error_formatter/json.rb +7 -1
- data/lib/grape/exceptions/base.rb +3 -2
- data/lib/grape/exceptions/missing_group_type.rb +8 -1
- data/lib/grape/exceptions/too_many_multipart_files.rb +11 -0
- data/lib/grape/exceptions/unsupported_group_type.rb +8 -1
- data/lib/grape/exceptions/validation.rb +0 -4
- data/lib/grape/locale/en.yml +9 -8
- data/lib/grape/middleware/auth/dsl.rb +0 -1
- data/lib/grape/middleware/error.rb +2 -2
- data/lib/grape/middleware/stack.rb +1 -1
- data/lib/grape/request.rb +3 -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/util/json.rb +2 -0
- data/lib/grape/validations/attributes_doc.rb +58 -0
- data/lib/grape/validations/params_scope.rb +67 -41
- data/lib/grape/validations/types/array_coercer.rb +0 -2
- data/lib/grape/validations/types/dry_type_coercer.rb +3 -7
- data/lib/grape/validations/types/invalid_value.rb +0 -7
- data/lib/grape/validations/types/primitive_coercer.rb +14 -6
- data/lib/grape/validations/types/set_coercer.rb +0 -2
- data/lib/grape/validations/types.rb +98 -30
- data/lib/grape/validations/validators/{all_or_none.rb → all_or_none_of_validator.rb} +0 -2
- data/lib/grape/validations/validators/{at_least_one_of.rb → at_least_one_of_validator.rb} +0 -2
- data/lib/grape/validations/validators/base.rb +7 -0
- data/lib/grape/validations/validators/{exactly_one_of.rb → exactly_one_of_validator.rb} +0 -2
- data/lib/grape/validations/validators/{mutual_exclusion.rb → mutual_exclusion_validator.rb} +0 -2
- data/lib/grape/validations.rb +16 -12
- data/lib/grape/version.rb +1 -1
- data/lib/grape.rb +74 -28
- data/spec/grape/api/custom_validations_spec.rb +41 -2
- data/spec/grape/api/deeply_included_options_spec.rb +0 -2
- data/spec/grape/api/defines_boolean_in_params_spec.rb +0 -2
- data/spec/grape/api/documentation_spec.rb +59 -0
- data/spec/grape/api/inherited_helpers_spec.rb +0 -2
- data/spec/grape/api/instance_spec.rb +0 -1
- data/spec/grape/api/invalid_format_spec.rb +0 -2
- data/spec/grape/api/namespace_parameters_in_route_spec.rb +0 -2
- data/spec/grape/api/nested_helpers_spec.rb +0 -2
- data/spec/grape/api/optional_parameters_in_route_spec.rb +0 -2
- data/spec/grape/api/parameters_modification_spec.rb +0 -2
- data/spec/grape/api/patch_method_helpers_spec.rb +0 -2
- data/spec/grape/api/recognize_path_spec.rb +0 -2
- data/spec/grape/api/required_parameters_in_route_spec.rb +0 -2
- data/spec/grape/api/required_parameters_with_invalid_method_spec.rb +0 -2
- data/spec/grape/api/routes_with_requirements_spec.rb +0 -2
- data/spec/grape/api/shared_helpers_exactly_one_of_spec.rb +0 -2
- data/spec/grape/api/shared_helpers_spec.rb +0 -2
- data/spec/grape/api_remount_spec.rb +0 -1
- data/spec/grape/api_spec.rb +23 -25
- data/spec/grape/config_spec.rb +0 -2
- data/spec/grape/dsl/callbacks_spec.rb +0 -2
- data/spec/grape/dsl/desc_spec.rb +2 -2
- data/spec/grape/dsl/headers_spec.rb +2 -4
- data/spec/grape/dsl/helpers_spec.rb +0 -2
- data/spec/grape/dsl/inside_route_spec.rb +10 -12
- data/spec/grape/dsl/logger_spec.rb +0 -2
- data/spec/grape/dsl/middleware_spec.rb +0 -2
- data/spec/grape/dsl/parameters_spec.rb +0 -2
- data/spec/grape/dsl/request_response_spec.rb +6 -8
- data/spec/grape/dsl/routing_spec.rb +1 -3
- data/spec/grape/dsl/settings_spec.rb +0 -2
- data/spec/grape/dsl/validations_spec.rb +0 -17
- data/spec/grape/endpoint/declared_spec.rb +2 -4
- data/spec/grape/endpoint_spec.rb +29 -9
- data/spec/grape/entity_spec.rb +0 -1
- data/spec/grape/exceptions/base_spec.rb +16 -2
- data/spec/grape/exceptions/body_parse_errors_spec.rb +0 -2
- data/spec/grape/exceptions/invalid_accept_header_spec.rb +3 -2
- data/spec/grape/exceptions/invalid_formatter_spec.rb +0 -2
- data/spec/grape/exceptions/invalid_response_spec.rb +0 -2
- data/spec/grape/exceptions/invalid_versioner_option_spec.rb +1 -3
- data/spec/grape/exceptions/missing_group_type_spec.rb +21 -0
- data/spec/grape/exceptions/missing_mime_type_spec.rb +0 -2
- data/spec/grape/exceptions/missing_option_spec.rb +1 -3
- data/spec/grape/exceptions/unknown_options_spec.rb +0 -2
- data/spec/grape/exceptions/unknown_validator_spec.rb +0 -2
- data/spec/grape/exceptions/unsupported_group_type_spec.rb +23 -0
- data/spec/grape/exceptions/validation_errors_spec.rb +0 -1
- data/spec/grape/exceptions/validation_spec.rb +1 -3
- data/spec/grape/extensions/param_builders/hash_spec.rb +0 -2
- data/spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb +0 -2
- data/spec/grape/extensions/param_builders/hashie/mash_spec.rb +0 -2
- data/spec/grape/integration/global_namespace_function_spec.rb +0 -2
- data/spec/grape/integration/rack_sendfile_spec.rb +0 -2
- data/spec/grape/integration/rack_spec.rb +6 -7
- data/spec/grape/loading_spec.rb +0 -2
- data/spec/grape/middleware/auth/base_spec.rb +0 -1
- data/spec/grape/middleware/auth/dsl_spec.rb +0 -2
- data/spec/grape/middleware/auth/strategies_spec.rb +0 -2
- data/spec/grape/middleware/base_spec.rb +7 -7
- data/spec/grape/middleware/error_spec.rb +6 -1
- data/spec/grape/middleware/exception_spec.rb +0 -2
- data/spec/grape/middleware/formatter_spec.rb +6 -8
- data/spec/grape/middleware/globals_spec.rb +0 -2
- data/spec/grape/middleware/stack_spec.rb +0 -2
- data/spec/grape/middleware/versioner/accept_version_header_spec.rb +0 -2
- data/spec/grape/middleware/versioner/header_spec.rb +18 -4
- data/spec/grape/middleware/versioner/param_spec.rb +0 -2
- data/spec/grape/middleware/versioner/path_spec.rb +0 -2
- data/spec/grape/middleware/versioner_spec.rb +0 -2
- data/spec/grape/named_api_spec.rb +0 -2
- data/spec/grape/parser_spec.rb +0 -2
- data/spec/grape/path_spec.rb +0 -2
- data/spec/grape/presenters/presenter_spec.rb +0 -2
- data/spec/grape/request_spec.rb +0 -2
- data/spec/grape/util/inheritable_setting_spec.rb +0 -1
- data/spec/grape/util/inheritable_values_spec.rb +0 -1
- data/spec/grape/util/reverse_stackable_values_spec.rb +0 -1
- data/spec/grape/util/stackable_values_spec.rb +0 -1
- data/spec/grape/util/strict_hash_configuration_spec.rb +0 -1
- data/spec/grape/validations/attributes_doc_spec.rb +153 -0
- data/spec/grape/validations/instance_behaivour_spec.rb +0 -2
- data/spec/grape/validations/multiple_attributes_iterator_spec.rb +0 -2
- data/spec/grape/validations/params_scope_spec.rb +315 -86
- data/spec/grape/validations/single_attribute_iterator_spec.rb +0 -2
- data/spec/grape/validations/types/array_coercer_spec.rb +0 -2
- data/spec/grape/validations/types/primitive_coercer_spec.rb +20 -5
- data/spec/grape/validations/types/set_coercer_spec.rb +0 -2
- data/spec/grape/validations/types_spec.rb +28 -2
- data/spec/grape/validations/validators/all_or_none_spec.rb +0 -2
- data/spec/grape/validations/validators/allow_blank_spec.rb +0 -2
- data/spec/grape/validations/validators/at_least_one_of_spec.rb +0 -2
- data/spec/grape/validations/validators/coerce_spec.rb +0 -2
- data/spec/grape/validations/validators/default_spec.rb +0 -2
- data/spec/grape/validations/validators/exactly_one_of_spec.rb +0 -2
- data/spec/grape/validations/validators/except_values_spec.rb +0 -2
- data/spec/grape/validations/validators/mutual_exclusion_spec.rb +0 -2
- data/spec/grape/validations/validators/presence_spec.rb +0 -2
- data/spec/grape/validations/validators/regexp_spec.rb +0 -2
- data/spec/grape/validations/validators/same_as_spec.rb +0 -2
- data/spec/grape/validations/validators/values_spec.rb +19 -2
- data/spec/grape/validations_spec.rb +78 -27
- data/spec/integration/multi_json/json_spec.rb +0 -2
- data/spec/integration/multi_xml/xml_spec.rb +0 -2
- data/spec/spec_helper.rb +9 -4
- metadata +134 -122
- data/spec/grape/dsl/configuration_spec.rb +0 -16
- data/spec/grape/validations/attributes_iterator_spec.rb +0 -6
- data/spec/support/eager_load.rb +0 -19
- /data/lib/grape/validations/validators/{allow_blank.rb → allow_blank_validator.rb} +0 -0
- /data/lib/grape/validations/validators/{as.rb → as_validator.rb} +0 -0
- /data/lib/grape/validations/validators/{coerce.rb → coerce_validator.rb} +0 -0
- /data/lib/grape/validations/validators/{default.rb → default_validator.rb} +0 -0
- /data/lib/grape/validations/validators/{except_values.rb → except_values_validator.rb} +0 -0
- /data/lib/grape/validations/validators/{presence.rb → presence_validator.rb} +0 -0
- /data/lib/grape/validations/validators/{regexp.rb → regexp_validator.rb} +0 -0
- /data/lib/grape/validations/validators/{same_as.rb → same_as_validator.rb} +0 -0
- /data/lib/grape/validations/validators/{values.rb → values_validator.rb} +0 -0
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.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
|
@@ -115,6 +121,7 @@ files:
|
|
115
121
|
- lib/grape/config.rb
|
116
122
|
- lib/grape/content_types.rb
|
117
123
|
- lib/grape/cookies.rb
|
124
|
+
- lib/grape/dry_types.rb
|
118
125
|
- lib/grape/dsl/api.rb
|
119
126
|
- lib/grape/dsl/callbacks.rb
|
120
127
|
- lib/grape/dsl/configuration.rb
|
@@ -151,6 +158,7 @@ files:
|
|
151
158
|
- lib/grape/exceptions/missing_mime_type.rb
|
152
159
|
- lib/grape/exceptions/missing_option.rb
|
153
160
|
- lib/grape/exceptions/missing_vendor_option.rb
|
161
|
+
- lib/grape/exceptions/too_many_multipart_files.rb
|
154
162
|
- lib/grape/exceptions/unknown_options.rb
|
155
163
|
- lib/grape/exceptions/unknown_parameter.rb
|
156
164
|
- lib/grape/exceptions/unknown_validator.rb
|
@@ -201,6 +209,7 @@ files:
|
|
201
209
|
- lib/grape/serve_stream/file_body.rb
|
202
210
|
- lib/grape/serve_stream/sendfile_response.rb
|
203
211
|
- lib/grape/serve_stream/stream_response.rb
|
212
|
+
- lib/grape/types/invalid_value.rb
|
204
213
|
- lib/grape/util/base_inheritable.rb
|
205
214
|
- lib/grape/util/cache.rb
|
206
215
|
- lib/grape/util/endpoint_configuration.rb
|
@@ -217,6 +226,7 @@ files:
|
|
217
226
|
- lib/grape/util/strict_hash_configuration.rb
|
218
227
|
- lib/grape/util/xml.rb
|
219
228
|
- lib/grape/validations.rb
|
229
|
+
- lib/grape/validations/attributes_doc.rb
|
220
230
|
- lib/grape/validations/attributes_iterator.rb
|
221
231
|
- lib/grape/validations/multiple_attributes_iterator.rb
|
222
232
|
- lib/grape/validations/params_scope.rb
|
@@ -235,25 +245,26 @@ files:
|
|
235
245
|
- lib/grape/validations/types/set_coercer.rb
|
236
246
|
- lib/grape/validations/types/variant_collection_coercer.rb
|
237
247
|
- lib/grape/validations/validator_factory.rb
|
238
|
-
- lib/grape/validations/validators/
|
239
|
-
- lib/grape/validations/validators/
|
240
|
-
- lib/grape/validations/validators/
|
241
|
-
- lib/grape/validations/validators/
|
248
|
+
- lib/grape/validations/validators/all_or_none_of_validator.rb
|
249
|
+
- lib/grape/validations/validators/allow_blank_validator.rb
|
250
|
+
- lib/grape/validations/validators/as_validator.rb
|
251
|
+
- lib/grape/validations/validators/at_least_one_of_validator.rb
|
242
252
|
- lib/grape/validations/validators/base.rb
|
243
|
-
- lib/grape/validations/validators/
|
244
|
-
- lib/grape/validations/validators/
|
245
|
-
- lib/grape/validations/validators/
|
246
|
-
- lib/grape/validations/validators/
|
253
|
+
- lib/grape/validations/validators/coerce_validator.rb
|
254
|
+
- lib/grape/validations/validators/default_validator.rb
|
255
|
+
- lib/grape/validations/validators/exactly_one_of_validator.rb
|
256
|
+
- lib/grape/validations/validators/except_values_validator.rb
|
247
257
|
- lib/grape/validations/validators/multiple_params_base.rb
|
248
|
-
- lib/grape/validations/validators/
|
249
|
-
- lib/grape/validations/validators/
|
250
|
-
- lib/grape/validations/validators/
|
251
|
-
- lib/grape/validations/validators/
|
252
|
-
- lib/grape/validations/validators/
|
258
|
+
- lib/grape/validations/validators/mutual_exclusion_validator.rb
|
259
|
+
- lib/grape/validations/validators/presence_validator.rb
|
260
|
+
- lib/grape/validations/validators/regexp_validator.rb
|
261
|
+
- lib/grape/validations/validators/same_as_validator.rb
|
262
|
+
- lib/grape/validations/validators/values_validator.rb
|
253
263
|
- lib/grape/version.rb
|
254
264
|
- spec/grape/api/custom_validations_spec.rb
|
255
265
|
- spec/grape/api/deeply_included_options_spec.rb
|
256
266
|
- spec/grape/api/defines_boolean_in_params_spec.rb
|
267
|
+
- spec/grape/api/documentation_spec.rb
|
257
268
|
- spec/grape/api/inherited_helpers_spec.rb
|
258
269
|
- spec/grape/api/instance_spec.rb
|
259
270
|
- spec/grape/api/invalid_format_spec.rb
|
@@ -272,7 +283,6 @@ files:
|
|
272
283
|
- spec/grape/api_spec.rb
|
273
284
|
- spec/grape/config_spec.rb
|
274
285
|
- spec/grape/dsl/callbacks_spec.rb
|
275
|
-
- spec/grape/dsl/configuration_spec.rb
|
276
286
|
- spec/grape/dsl/desc_spec.rb
|
277
287
|
- spec/grape/dsl/headers_spec.rb
|
278
288
|
- spec/grape/dsl/helpers_spec.rb
|
@@ -293,10 +303,12 @@ files:
|
|
293
303
|
- spec/grape/exceptions/invalid_formatter_spec.rb
|
294
304
|
- spec/grape/exceptions/invalid_response_spec.rb
|
295
305
|
- spec/grape/exceptions/invalid_versioner_option_spec.rb
|
306
|
+
- spec/grape/exceptions/missing_group_type_spec.rb
|
296
307
|
- spec/grape/exceptions/missing_mime_type_spec.rb
|
297
308
|
- spec/grape/exceptions/missing_option_spec.rb
|
298
309
|
- spec/grape/exceptions/unknown_options_spec.rb
|
299
310
|
- spec/grape/exceptions/unknown_validator_spec.rb
|
311
|
+
- spec/grape/exceptions/unsupported_group_type_spec.rb
|
300
312
|
- spec/grape/exceptions/validation_errors_spec.rb
|
301
313
|
- spec/grape/exceptions/validation_spec.rb
|
302
314
|
- spec/grape/extensions/param_builders/hash_spec.rb
|
@@ -330,7 +342,7 @@ files:
|
|
330
342
|
- spec/grape/util/reverse_stackable_values_spec.rb
|
331
343
|
- spec/grape/util/stackable_values_spec.rb
|
332
344
|
- spec/grape/util/strict_hash_configuration_spec.rb
|
333
|
-
- spec/grape/validations/
|
345
|
+
- spec/grape/validations/attributes_doc_spec.rb
|
334
346
|
- spec/grape/validations/instance_behaivour_spec.rb
|
335
347
|
- spec/grape/validations/multiple_attributes_iterator_spec.rb
|
336
348
|
- spec/grape/validations/params_scope_spec.rb
|
@@ -361,7 +373,6 @@ files:
|
|
361
373
|
- spec/support/basic_auth_encode_helpers.rb
|
362
374
|
- spec/support/chunks.rb
|
363
375
|
- spec/support/content_type_helpers.rb
|
364
|
-
- spec/support/eager_load.rb
|
365
376
|
- spec/support/endpoint_faker.rb
|
366
377
|
- spec/support/file_streamer.rb
|
367
378
|
- spec/support/integer_helpers.rb
|
@@ -371,10 +382,10 @@ licenses:
|
|
371
382
|
- MIT
|
372
383
|
metadata:
|
373
384
|
bug_tracker_uri: https://github.com/ruby-grape/grape/issues
|
374
|
-
changelog_uri: https://github.com/ruby-grape/grape/blob/v1.
|
375
|
-
documentation_uri: https://www.rubydoc.info/gems/grape/1.
|
376
|
-
source_code_uri: https://github.com/ruby-grape/grape/tree/v1.
|
377
|
-
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:
|
378
389
|
rdoc_options: []
|
379
390
|
require_paths:
|
380
391
|
- lib
|
@@ -382,130 +393,131 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
382
393
|
requirements:
|
383
394
|
- - ">="
|
384
395
|
- !ruby/object:Gem::Version
|
385
|
-
version: 2.
|
396
|
+
version: 2.6.0
|
386
397
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
387
398
|
requirements:
|
388
399
|
- - ">="
|
389
400
|
- !ruby/object:Gem::Version
|
390
401
|
version: '0'
|
391
402
|
requirements: []
|
392
|
-
rubygems_version: 3.
|
393
|
-
signing_key:
|
403
|
+
rubygems_version: 3.0.3
|
404
|
+
signing_key:
|
394
405
|
specification_version: 4
|
395
406
|
summary: A simple Ruby framework for building REST-like APIs.
|
396
407
|
test_files:
|
397
|
-
- spec/
|
398
|
-
- spec/
|
399
|
-
- spec/
|
400
|
-
- spec/
|
401
|
-
- spec/
|
402
|
-
- spec/
|
403
|
-
- spec/
|
404
|
-
- spec/
|
405
|
-
- spec/
|
406
|
-
- spec/
|
407
|
-
- spec/
|
408
|
-
- spec/
|
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
|
414
|
-
- spec/grape/api_remount_spec.rb
|
415
|
-
- spec/grape/api_spec.rb
|
416
|
-
- spec/grape/config_spec.rb
|
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
|
434
|
-
- spec/grape/exceptions/body_parse_errors_spec.rb
|
435
|
-
- spec/grape/exceptions/invalid_accept_header_spec.rb
|
436
|
-
- spec/grape/exceptions/invalid_formatter_spec.rb
|
437
|
-
- spec/grape/exceptions/invalid_response_spec.rb
|
438
|
-
- spec/grape/exceptions/invalid_versioner_option_spec.rb
|
439
|
-
- spec/grape/exceptions/missing_mime_type_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
|
445
|
-
- spec/grape/extensions/param_builders/hash_spec.rb
|
446
|
-
- spec/grape/extensions/param_builders/hash_with_indifferent_access_spec.rb
|
447
|
-
- spec/grape/extensions/param_builders/hashie/mash_spec.rb
|
448
|
-
- spec/grape/integration/global_namespace_function_spec.rb
|
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
|
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
|
456
420
|
- spec/grape/middleware/error_spec.rb
|
457
|
-
- spec/grape/middleware/exception_spec.rb
|
458
|
-
- spec/grape/middleware/formatter_spec.rb
|
459
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
|
460
426
|
- spec/grape/middleware/stack_spec.rb
|
427
|
+
- spec/grape/middleware/exception_spec.rb
|
428
|
+
- spec/grape/middleware/versioner_spec.rb
|
461
429
|
- spec/grape/middleware/versioner/accept_version_header_spec.rb
|
462
430
|
- spec/grape/middleware/versioner/header_spec.rb
|
463
|
-
- spec/grape/middleware/versioner/param_spec.rb
|
464
431
|
- spec/grape/middleware/versioner/path_spec.rb
|
465
|
-
- spec/grape/middleware/
|
466
|
-
- spec/grape/
|
467
|
-
- spec/grape/
|
468
|
-
- spec/grape/
|
469
|
-
- spec/grape/
|
470
|
-
- spec/grape/
|
471
|
-
- spec/grape/util/inheritable_setting_spec.rb
|
472
|
-
- 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
|
473
438
|
- spec/grape/util/reverse_stackable_values_spec.rb
|
474
439
|
- spec/grape/util/stackable_values_spec.rb
|
440
|
+
- spec/grape/util/inheritable_setting_spec.rb
|
475
441
|
- spec/grape/util/strict_hash_configuration_spec.rb
|
476
|
-
- spec/grape/
|
477
|
-
- spec/grape/
|
478
|
-
- spec/grape/
|
479
|
-
- 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
|
480
463
|
- spec/grape/validations/single_attribute_iterator_spec.rb
|
481
|
-
- spec/grape/validations/types/array_coercer_spec.rb
|
482
464
|
- spec/grape/validations/types/primitive_coercer_spec.rb
|
483
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
|
484
471
|
- spec/grape/validations/types_spec.rb
|
485
|
-
- spec/grape/validations/validators/
|
486
|
-
- spec/grape/validations/validators/
|
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
|
472
|
+
- spec/grape/validations/validators/regexp_spec.rb
|
473
|
+
- spec/grape/validations/validators/mutual_exclusion_spec.rb
|
490
474
|
- spec/grape/validations/validators/exactly_one_of_spec.rb
|
491
475
|
- spec/grape/validations/validators/except_values_spec.rb
|
492
|
-
- spec/grape/validations/validators/mutual_exclusion_spec.rb
|
493
476
|
- spec/grape/validations/validators/presence_spec.rb
|
494
|
-
- spec/grape/validations/validators/
|
477
|
+
- spec/grape/validations/validators/all_or_none_spec.rb
|
478
|
+
- spec/grape/validations/validators/allow_blank_spec.rb
|
495
479
|
- spec/grape/validations/validators/same_as_spec.rb
|
480
|
+
- spec/grape/validations/validators/default_spec.rb
|
496
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
|
497
484
|
- spec/grape/validations/validators/zh-CN.yml
|
498
|
-
- spec/grape/
|
499
|
-
- spec/
|
500
|
-
- spec/
|
501
|
-
- spec/
|
502
|
-
- spec/
|
503
|
-
- spec/
|
504
|
-
- spec/
|
505
|
-
- spec/
|
506
|
-
- spec/
|
507
|
-
- spec/
|
508
|
-
- spec/
|
509
|
-
- spec/
|
510
|
-
- spec/
|
511
|
-
- 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
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
|
5
|
-
module Grape
|
6
|
-
module DSL
|
7
|
-
module ConfigurationSpec
|
8
|
-
class Dummy
|
9
|
-
include Grape::DSL::Configuration
|
10
|
-
end
|
11
|
-
end
|
12
|
-
describe Configuration do
|
13
|
-
subject { Class.new(ConfigurationSpec::Dummy) }
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/spec/support/eager_load.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Grape uses autoload https://api.rubyonrails.org/classes/ActiveSupport/Autoload.html.
|
4
|
-
# When a class/module get added to the list, ActiveSupport doesn't check whether it really exists.
|
5
|
-
# This method loads all classes/modules defined via autoload to be sure only existing
|
6
|
-
# classes/modules were listed.
|
7
|
-
def eager_load!(scope = Grape)
|
8
|
-
# get modules
|
9
|
-
scope.constants.each do |const_name|
|
10
|
-
const = scope.const_get(const_name)
|
11
|
-
|
12
|
-
next unless const.respond_to?(:eager_load!)
|
13
|
-
|
14
|
-
const.eager_load!
|
15
|
-
|
16
|
-
# check its modules, they might need to be loaded as well.
|
17
|
-
eager_load!(const)
|
18
|
-
end
|
19
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|