openapi_contracts 0.16.7 → 0.17.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: 23dd8bf2e1034f228bccf143435d86259aab3c54107192bd70ad86f562efc634
|
|
4
|
+
data.tar.gz: 704a4e76a3230e638e8cc7df6ad96691ea64a77c12d0ca3dd84cf674f9a586cd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abddf34c06c34160b6590167918d90607335867e4740f58a8a548d6d546d38d0f1525a8b865062a250ab374c29e5e2d5b87955b4777c94862948f55e661a98f3
|
|
7
|
+
data.tar.gz: 218ea3f920c4bedf9fa48548b013dd3514c51d3c9412d27b7167ee4f66fb9c9e357f00c0305ef42c1cc964a986aed11caf206da0593958d372f441f3b57bb585
|
|
@@ -11,11 +11,9 @@ module OpenapiContracts
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def headers
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Doc::Header.new(key, val)
|
|
18
|
-
end
|
|
14
|
+
@headers ||= Array.wrap(
|
|
15
|
+
@schema.navigate('headers')&.each&.map { |key, schema| Doc::Header.new(key, schema.to_h) }
|
|
16
|
+
)
|
|
19
17
|
end
|
|
20
18
|
|
|
21
19
|
def schema_for(media_type)
|
|
@@ -19,6 +19,9 @@ module OpenapiContracts::Validators
|
|
|
19
19
|
if value.blank?
|
|
20
20
|
@errors << "Missing header #{header.name}" if header.required?
|
|
21
21
|
else
|
|
22
|
+
# Header values arrive as strings; deserialize to the schema's type
|
|
23
|
+
# (per `style: simple`) before validating, as Doc::Parameter does.
|
|
24
|
+
value = OpenapiParameters::Converter.convert(value, header.schema)
|
|
22
25
|
schemer = JSONSchemer.schema(header.schema)
|
|
23
26
|
unless schemer.valid?(value)
|
|
24
27
|
validation_errors = schemer.validate(value).to_a
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openapi_contracts
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.17.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mkon
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-06-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -154,7 +154,7 @@ dependencies:
|
|
|
154
154
|
- - "~>"
|
|
155
155
|
- !ruby/object:Gem::Version
|
|
156
156
|
version: 0.22.0
|
|
157
|
-
description:
|
|
157
|
+
description:
|
|
158
158
|
email:
|
|
159
159
|
- konstantin@munteanu.de
|
|
160
160
|
executables: []
|
|
@@ -199,7 +199,7 @@ licenses:
|
|
|
199
199
|
- MIT
|
|
200
200
|
metadata:
|
|
201
201
|
rubygems_mfa_required: 'true'
|
|
202
|
-
post_install_message:
|
|
202
|
+
post_install_message:
|
|
203
203
|
rdoc_options: []
|
|
204
204
|
require_paths:
|
|
205
205
|
- lib
|
|
@@ -217,8 +217,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
217
217
|
- !ruby/object:Gem::Version
|
|
218
218
|
version: '0'
|
|
219
219
|
requirements: []
|
|
220
|
-
rubygems_version: 3.
|
|
221
|
-
signing_key:
|
|
220
|
+
rubygems_version: 3.0.3.1
|
|
221
|
+
signing_key:
|
|
222
222
|
specification_version: 4
|
|
223
223
|
summary: Openapi schemas as API contracts
|
|
224
224
|
test_files: []
|