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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1df44d337ca5774bd5e85d09928e38ba0e37a9020ee8a4112d61cbc44281d01
4
- data.tar.gz: 36afa88b1f939b18ed0d1396b414d698e66fd8c90eb3074f40e31d7beb5eaaf0
3
+ metadata.gz: 2d3e13bc24feccc8015701ca7360e77fbb8c44d8c7dad9e87310f52b04ddebe6
4
+ data.tar.gz: 8a5895ce7b3a5a7a2669e862f4821125538573a6e694db36e8d2687580c3e0c9
5
5
  SHA512:
6
- metadata.gz: dd7f57bda0e368f6d2ec35987266511492bc495591ce904cf44560e3397c5110b2c4f9cddb4bfabf0cdc2fbf6a9a002b558b5ba60ea77d5ac464366eebe2b153
7
- data.tar.gz: 674c0da4c4bab2fcb674d581f930dcf6b298f1c87c26c02cbcd22503250b9d9bc280de899b35cb14244249f46a1800432a3a57ae4c7e42189dc7dc716da6483a
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: @query_parser&.unpack(request.env[Rack::QUERY_STRING]),
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenapiFirst
4
- VERSION = '2.7.3'
4
+ VERSION = '2.7.4'
5
5
  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.3
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.3.3
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.3.3
62
+ version: 0.5.1
63
63
  - - "<"
64
64
  - !ruby/object:Gem::Version
65
65
  version: '2.0'