openapi_parser 2.2.2 → 2.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17d6d8c9652ee5f13115232759e44f4d5c2f1d3b47cacac3a9a15af9c83ade09
|
4
|
+
data.tar.gz: 015d2a2c0fcf91517372e3a00ca7704aa07a4b3f349200702a3a082a8c103cd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 454ed33381136206a4cb368e965c0e138f71455b344f85116da53bc3bb90a34ecc4a7d238b2f6422d5c83b32d4ea53cc3b2c4dddfa76f4cefbde7c6d89142d27
|
7
|
+
data.tar.gz: 149c6e48652bcc5126fca33c5be934de575ca429da64638edeb3b1ddcc00be56da3c9921d066ce03a76728070cee98a877537183eb1514b67d69766a605fdeb3
|
data/.github/workflows/ci.yaml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 2.2.4 (2025-02-27)
|
4
|
+
* skip validation if format is set to `binary` #180
|
5
|
+
|
6
|
+
## 2.2.3 (2024-12-12)
|
7
|
+
* fix parent_discriminator_schema nil from all_of_validator #179
|
8
|
+
|
3
9
|
## 2.2.2 (2024-11-21)
|
4
10
|
* make content-type lookup case-insensitive #178
|
5
11
|
|
@@ -18,7 +18,7 @@ class OpenAPIParser::SchemaValidator
|
|
18
18
|
value,
|
19
19
|
s,
|
20
20
|
:parent_all_of => true,
|
21
|
-
parent_discriminator_schemas: keyword_args[:parent_discriminator_schemas]
|
21
|
+
parent_discriminator_schemas: keyword_args[:parent_discriminator_schemas] || []
|
22
22
|
)
|
23
23
|
|
24
24
|
if s.type == "object"
|
@@ -8,7 +8,18 @@ class OpenAPIParser::SchemaValidator
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def coerce_and_validate(value, schema, **_keyword_args)
|
11
|
-
|
11
|
+
unless value.kind_of?(String)
|
12
|
+
# Skip validation if the format is `binary`, even if the value is not an actual string.
|
13
|
+
# ref: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#data-types
|
14
|
+
if schema.format == 'binary'
|
15
|
+
# TODO:
|
16
|
+
# It would be better to check whether the value is an instance of `Rack::Multipart::UploadFile`,
|
17
|
+
# `ActionDispatch::Http::UploadedFile`, or another similar class.
|
18
|
+
return [value, nil]
|
19
|
+
end
|
20
|
+
|
21
|
+
return OpenAPIParser::ValidateError.build_error_result(value, schema)
|
22
|
+
end
|
12
23
|
|
13
24
|
value, err = check_enum_include(value, schema)
|
14
25
|
return [nil, err] if err
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapi_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ota42y
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|