openapi_first 1.3.5 → 1.3.6
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/middlewares/response_validation.rb +9 -1
- data/lib/openapi_first/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 221362a78a788c449a8c11af9c40fc91bf307c82ee79d0931c94f39bb22901bc
|
4
|
+
data.tar.gz: d9b806ed56371199552b4081d2b6b220279b925b9fdbdaa90ce47623c86e4bff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c5ceac8c85f7d074983e5d237febe8ecf9ec3414a5ecb1a5bd8af43259eb2c83621ac867ca9b1d5420a3dda7518e131ed2ac1f08b86d71fa6fdfccbf76e1885
|
7
|
+
data.tar.gz: 92c44316bf96d31841a959898efcd20e08bc223f233e26af253cc3575dbf29680b13e27ab628eb9bb9544371c08c0d7aea42b5aaf8bef75d369299067e6eb0ca
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 1.3.6
|
6
|
+
|
7
|
+
- Fix Rack 2 / Rails 6 compatibility ([#246](https://github.com/ahx/openapi_first/issues/246)
|
8
|
+
|
5
9
|
## 1.3.5
|
6
10
|
|
7
11
|
- Added support for `/some/{kebab-cased}` path parameters ([#245](https://github.com/ahx/openapi_first/issues/245))
|
@@ -24,13 +24,21 @@ module OpenapiFirst
|
|
24
24
|
def call(env)
|
25
25
|
request = find_request(env)
|
26
26
|
status, headers, body = @app.call(env)
|
27
|
-
body = body
|
27
|
+
body = read_body(body)
|
28
28
|
request.validate_response(Rack::Response[status, headers, body], raise_error: true)
|
29
29
|
[status, headers, body]
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
|
+
def read_body(body)
|
35
|
+
return body.to_ary if body.respond_to?(:to_ary)
|
36
|
+
|
37
|
+
result = []
|
38
|
+
body.each { |part| result << part }
|
39
|
+
result
|
40
|
+
end
|
41
|
+
|
34
42
|
def find_request(env)
|
35
43
|
env[REQUEST] ||= @definition.request(Rack::Request.new(env))
|
36
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapi_first
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Haller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hana
|