openapi_first 2.7.3 → 2.7.4
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 +4 -0
- data/lib/openapi_first/request_parser.rb +9 -1
- data/lib/openapi_first/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d3e13bc24feccc8015701ca7360e77fbb8c44d8c7dad9e87310f52b04ddebe6
|
4
|
+
data.tar.gz: 8a5895ce7b3a5a7a2669e862f4821125538573a6e694db36e8d2687580c3e0c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3420becb820a470942b12e39d7e59197f9a50696a0f63c2af601ce26cad4e95c6b6e9d915e5b3f4528da78bf1f012993af9401d1863578e8e64c2059896c71bb
|
7
|
+
data.tar.gz: fe61cf2f437b9a725b377b7dcc5917ac130639ca67514450bee3ba919f289f083fa232b9a94770d175232da2546b5b999c5e544abe20d0dba060adc6d4eb6f07
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 2.7.4
|
6
|
+
|
7
|
+
- Return 400 if Rack cannot parse query string instead of raising an exception. Fixes https://github.com/ahx/openapi_first/issues/372
|
8
|
+
|
5
9
|
## 2.7.3
|
6
10
|
|
7
11
|
- Accept loading OAD documents with numeric status codes. Fixes "Unknown reference" error. https://github.com/ahx/openapi_first/issues/367
|
@@ -27,11 +27,19 @@ module OpenapiFirst
|
|
27
27
|
def parse(request, route_params:)
|
28
28
|
ParsedRequest.new(
|
29
29
|
path: @path_parser&.unpack(route_params),
|
30
|
-
query:
|
30
|
+
query: parse_query(request.env[Rack::QUERY_STRING]),
|
31
31
|
headers: @headers_parser&.unpack_env(request.env),
|
32
32
|
cookies: @cookies_parser&.unpack(request.env[Rack::HTTP_COOKIE]),
|
33
33
|
body: @body_parsers&.call(request)
|
34
34
|
)
|
35
35
|
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def parse_query(query_string)
|
40
|
+
@query_parser&.unpack(query_string)
|
41
|
+
rescue OpenapiParameters::InvalidParameterError
|
42
|
+
Failure.fail!(:invalid_query, message: 'Invalid query parameter.')
|
43
|
+
end
|
36
44
|
end
|
37
45
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapi_first
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Haller
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
requirements:
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: 0.
|
52
|
+
version: 0.5.1
|
53
53
|
- - "<"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '2.0'
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.
|
62
|
+
version: 0.5.1
|
63
63
|
- - "<"
|
64
64
|
- !ruby/object:Gem::Version
|
65
65
|
version: '2.0'
|