fun_with_json_api 0.0.11.3 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/fun_with_json_api/attributes/decimal_attribute.rb +1 -1
- data/lib/fun_with_json_api/find_collection_from_document.rb +2 -2
- data/lib/fun_with_json_api/find_resource_from_document.rb +2 -2
- data/lib/fun_with_json_api/middleware/catch_json_api_parse_errors.rb +1 -1
- data/lib/fun_with_json_api/railtie.rb +4 -10
- data/lib/fun_with_json_api/schema_validators/check_collection_has_all_members.rb +2 -2
- data/lib/fun_with_json_api/schema_validators/check_collection_is_authorized.rb +2 -2
- data/lib/fun_with_json_api/schema_validators/check_relationship_names.rb +2 -2
- data/lib/fun_with_json_api/schema_validators/check_resource_is_authorized.rb +2 -2
- data/lib/fun_with_json_api/version.rb +1 -1
- data/spec/dummy/app/assets/config/manifest.js +2 -0
- data/spec/dummy/log/test.log +1639 -72761
- data/spec/fixtures/active_record.rb +1 -1
- data/spec/fun_with_json_api/controller_methods_spec.rb +3 -3
- data/spec/fun_with_json_api/deserializer_spec.rb +5 -5
- data/spec/fun_with_json_api/railtie_spec.rb +6 -7
- data/spec/requests/request_parsing_spec.rb +29 -14
- data/spec/spec_helper.rb +0 -1
- metadata +47 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7d1a03f1e96d729456ac611fcffec59bc16aa2924f8230f04cbcf232034717d8
|
4
|
+
data.tar.gz: a1e03d0552be4c1e49c6f56be013619cca221b08e3dcde68f883e7eb73345235
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 659ccdb1092b4a1bba10bcb8c2666cc14ac7f40803837cd134264c87ebb46fef14f09c50a94d7fac4eea85564a9be475440925543202a47873f52986debfa130
|
7
|
+
data.tar.gz: e11517115fb82e7f62783a135890691f7ab7faf74eec97f0b975c0c5fef175cd20f680019422c9279e2fce31842f30fd3d9f40f8f3e6404295ba8e8fb91e629b
|
@@ -9,7 +9,7 @@ module FunWithJsonApi
|
|
9
9
|
|
10
10
|
def call(env)
|
11
11
|
@app.call(env)
|
12
|
-
rescue ActionDispatch::
|
12
|
+
rescue ActionDispatch::Http::Parameters::ParseError => error
|
13
13
|
if env['CONTENT_TYPE'] =~ JSON_API_REGEX && respond_with_json_api_error?(env)
|
14
14
|
build_json_api_parse_error_response
|
15
15
|
else
|
@@ -24,16 +24,10 @@ module FunWithJsonApi
|
|
24
24
|
end
|
25
25
|
|
26
26
|
# Add Middleware for catching parser errors
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
)
|
32
|
-
else
|
33
|
-
app.config.middleware.insert_before(
|
34
|
-
parsers, 'FunWithJsonApi::Middleware::CatchJsonApiParseErrors'
|
35
|
-
)
|
36
|
-
end
|
27
|
+
ActionDispatch::Request.parameter_parsers = parsers::DEFAULT_PARSERS
|
28
|
+
app.config.middleware.use(
|
29
|
+
FunWithJsonApi::Middleware::CatchJsonApiParseErrors
|
30
|
+
)
|
37
31
|
end
|
38
32
|
initializer :register_json_api_renderer do
|
39
33
|
ActionController::Renderers.add :json_api do |json, options|
|