openapi_parser 2.1.0 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/ci.yaml +2 -1
- data/CHANGELOG.md +22 -1
- data/lib/openapi_parser/schema_validator/string_validator.rb +2 -5
- data/lib/openapi_parser/schemas/schema.rb +1 -0
- data/lib/openapi_parser/version.rb +1 -1
- data/lib/openapi_parser.rb +2 -5
- data/openapi_parser.gemspec +2 -3
- metadata +10 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5bbbc0335472ed4352c767db92dc1ed0259548e6d49ece1f5b5da3836fbdbc5
|
4
|
+
data.tar.gz: bb600e479aff2c4b7ac0314215f49d3058491e93fde59240cd47339853a8ecf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53f5d120721d58ae47a555a036ac037fbb5460cbf315f918b7f881bb1a5f4fffee5bad46118dfd085441fcd65c01f133bb84834e728582a8008aaeb46a943a3e
|
7
|
+
data.tar.gz: 6ed888572b972db4ca33daffbfdef569de6f41153c5e798f42ee68badbe8154c1e206ec01300522d15aff56be1ecb5e4b4bd1209e99fc4da789e78ea4d1ba88f
|
data/.github/workflows/ci.yaml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,35 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 2.2.1 (2024-10-23)
|
4
|
+
* revert schemas validation in additionalProperties and remove additionalProperties logic from allof (breaking things for me, will revisit)
|
5
|
+
|
6
|
+
## 2.2.0 (2024-10-23)
|
7
|
+
### Fixed
|
8
|
+
* support schemas validation in additionalProperties and remove additionalProperties logic from allof
|
9
|
+
* suppress method redefined warning
|
10
|
+
* add base64 dev dependency for ruby-head compatibility
|
11
|
+
* remove no longer needed activesupport dev dep thanks to a fix upstream
|
12
|
+
* add dependabot config
|
13
|
+
* remove no longer used code for old rubies
|
14
|
+
* bump actions/checkout
|
15
|
+
* add ruby 3.3 to test matrix
|
16
|
+
* fix uuid validation logic (make it more strict)
|
17
|
+
|
3
18
|
## 2.1.0 (2024-04-03)
|
4
19
|
### Fixed
|
5
20
|
* Add full-date compliant date format validation #164
|
6
21
|
|
7
|
-
##
|
22
|
+
## 2.0.0 (2023-10-15)
|
23
|
+
|
8
24
|
### Added
|
25
|
+
|
9
26
|
* Support for uniqueItems in array #154
|
10
27
|
* Fix nullable field does not work with allOf, anyOf and oneOf keyword #128
|
11
28
|
|
29
|
+
### Other
|
30
|
+
|
31
|
+
* Drop Ruby 2.6 Support #158
|
32
|
+
|
12
33
|
## 1.0.0 (2021-02-03)
|
13
34
|
### Added
|
14
35
|
* Add date-time format validation #126
|
@@ -55,10 +55,7 @@ class OpenAPIParser::SchemaValidator
|
|
55
55
|
def validate_email_format(value, schema)
|
56
56
|
return [value, nil] unless schema.format == 'email'
|
57
57
|
|
58
|
-
|
59
|
-
# So when we drop ruby 2.3 support we use match? method because this method add ruby 2.4
|
60
|
-
#return [value, nil] if value.match?(URI::MailTo::EMAIL_REGEXP)
|
61
|
-
return [value, nil] if value.match(URI::MailTo::EMAIL_REGEXP)
|
58
|
+
return [value, nil] if value.match?(URI::MailTo::EMAIL_REGEXP)
|
62
59
|
|
63
60
|
return [nil, OpenAPIParser::InvalidEmailFormat.new(value, schema.object_reference)]
|
64
61
|
end
|
@@ -66,7 +63,7 @@ class OpenAPIParser::SchemaValidator
|
|
66
63
|
def validate_uuid_format(value, schema)
|
67
64
|
return [value, nil] unless schema.format == 'uuid'
|
68
65
|
|
69
|
-
return [value, nil] if value.match(
|
66
|
+
return [value, nil] if value.match(/^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$/)
|
70
67
|
|
71
68
|
return [nil, OpenAPIParser::InvalidUUIDFormat.new(value, schema.object_reference)]
|
72
69
|
end
|
@@ -110,6 +110,7 @@ module OpenAPIParser::Schemas
|
|
110
110
|
openapi_attr_object :additional_properties, Schema, reference: true, allow_data_type: true, schema_key: :additionalProperties
|
111
111
|
# additional_properties have default value
|
112
112
|
# we should add default value feature in openapi_attr_object method, but we need temporary fix so override attr_reader
|
113
|
+
remove_method :additional_properties
|
113
114
|
def additional_properties
|
114
115
|
@additional_properties.nil? ? true : @additional_properties
|
115
116
|
end
|
data/lib/openapi_parser.rb
CHANGED
@@ -81,14 +81,11 @@ module OpenAPIParser
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def parse_yaml(content)
|
84
|
-
|
85
|
-
(Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.6.0")) ?
|
86
|
-
Psych.safe_load(content, [Date, Time]) :
|
87
|
-
Psych.safe_load(content, permitted_classes: [Date, Time])
|
84
|
+
Psych.safe_load(content, permitted_classes: [Date, Time])
|
88
85
|
end
|
89
86
|
|
90
87
|
def parse_json(content)
|
91
|
-
raise "json content is nil" unless content
|
88
|
+
raise "json content is nil" unless content
|
92
89
|
JSON.parse(content)
|
93
90
|
end
|
94
91
|
|
data/openapi_parser.gemspec
CHANGED
@@ -35,7 +35,6 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency 'rspec-parameterized'
|
36
36
|
spec.add_development_dependency 'simplecov'
|
37
37
|
spec.add_development_dependency "steep"
|
38
|
-
# for steep
|
39
|
-
|
40
|
-
spec.add_development_dependency "activesupport", '~> 6.0'
|
38
|
+
# for steep + ruby-head
|
39
|
+
spec.add_development_dependency 'base64', '~> 0.2.0'
|
41
40
|
end
|
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.1
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ota42y
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,34 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: pry
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.12.0
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.12.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: pry-byebug
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
41
|
- !ruby/object:Gem::Dependency
|
70
42
|
name: rake
|
71
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -137,19 +109,19 @@ dependencies:
|
|
137
109
|
- !ruby/object:Gem::Version
|
138
110
|
version: '0'
|
139
111
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
112
|
+
name: base64
|
141
113
|
requirement: !ruby/object:Gem::Requirement
|
142
114
|
requirements:
|
143
115
|
- - "~>"
|
144
116
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
117
|
+
version: 0.2.0
|
146
118
|
type: :development
|
147
119
|
prerelease: false
|
148
120
|
version_requirements: !ruby/object:Gem::Requirement
|
149
121
|
requirements:
|
150
122
|
- - "~>"
|
151
123
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
124
|
+
version: 0.2.0
|
153
125
|
description: parser for OpenAPI 3.0 or later
|
154
126
|
email:
|
155
127
|
- ota42y@gmail.com
|
@@ -157,6 +129,7 @@ executables: []
|
|
157
129
|
extensions: []
|
158
130
|
extra_rdoc_files: []
|
159
131
|
files:
|
132
|
+
- ".github/dependabot.yml"
|
160
133
|
- ".github/workflows/ci.yaml"
|
161
134
|
- ".gitignore"
|
162
135
|
- ".rspec"
|
@@ -250,7 +223,7 @@ homepage: https://github.com/ota42y/openapi_parser
|
|
250
223
|
licenses:
|
251
224
|
- MIT
|
252
225
|
metadata: {}
|
253
|
-
post_install_message:
|
226
|
+
post_install_message:
|
254
227
|
rdoc_options: []
|
255
228
|
require_paths:
|
256
229
|
- lib
|
@@ -265,8 +238,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
238
|
- !ruby/object:Gem::Version
|
266
239
|
version: '0'
|
267
240
|
requirements: []
|
268
|
-
rubygems_version: 3.
|
269
|
-
signing_key:
|
241
|
+
rubygems_version: 3.5.18
|
242
|
+
signing_key:
|
270
243
|
specification_version: 4
|
271
244
|
summary: OpenAPI3 parser
|
272
245
|
test_files: []
|