committee 4.1.0 → 4.2.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43984e56c905ff9e141e1ed49af5c9e51b07c39bda8bc268d195dc5799809d89
|
4
|
+
data.tar.gz: 76a6269ac7cc8237a63b2ae6c69ac512a60cecabaed7564dee88cd3adfa9328e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f79ef24531c7b81489d12ea59e9da42e570236554a84c064c8478625e29167c3fef7245196a2c48d2a0a31ab33639417d47527321b321172f32c5f80fce5f46b
|
7
|
+
data.tar.gz: 68c8ad83aa2392ba1d31d440edb54b1301b6c37e093f7d466c0a9f406510a0efbdf6c9ea8aacf1ddf051fae31c03d2bd777accd90101bd321037dfdafd0affbf
|
@@ -11,9 +11,9 @@ module Committee
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def handle(request)
|
14
|
-
|
15
|
-
status, headers, response = @app.call(request.env)
|
14
|
+
status, headers, response = @app.call(request.env)
|
16
15
|
|
16
|
+
begin
|
17
17
|
v = build_schema_validator(request)
|
18
18
|
v.response_validate(status, headers, response) if v.link_exist? && self.class.validate?(status, validate_success_only)
|
19
19
|
|
@@ -457,6 +457,16 @@ describe Committee::Middleware::RequestValidation do
|
|
457
457
|
end
|
458
458
|
end
|
459
459
|
|
460
|
+
it 'does not suppress application error' do
|
461
|
+
@app = new_rack_app_with_lambda(lambda { |_|
|
462
|
+
JSON.load('-') # invalid json
|
463
|
+
}, schema: open_api_3_schema, raise: true)
|
464
|
+
|
465
|
+
assert_raises(JSON::ParserError) do
|
466
|
+
get "/error", nil
|
467
|
+
end
|
468
|
+
end
|
469
|
+
|
460
470
|
private
|
461
471
|
|
462
472
|
def new_rack_app(options = {})
|
@@ -215,6 +215,19 @@ describe Committee::Middleware::ResponseValidation do
|
|
215
215
|
end
|
216
216
|
end
|
217
217
|
|
218
|
+
it 'does not suppress application error' do
|
219
|
+
@app = Rack::Builder.new {
|
220
|
+
use Committee::Middleware::ResponseValidation, {schema: open_api_3_schema, raise: true}
|
221
|
+
run lambda { |_|
|
222
|
+
JSON.load('-') # invalid json
|
223
|
+
}
|
224
|
+
}
|
225
|
+
|
226
|
+
assert_raises(JSON::ParserError) do
|
227
|
+
get "/error", nil
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
218
231
|
private
|
219
232
|
|
220
233
|
def new_response_rack(response, headers = {}, options = {}, rack_options = {})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: committee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandur
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-08-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json_schema
|