openapi3_parser 0.9.0 → 0.9.1
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/.github/workflows/ci.yml +3 -3
- data/.ruby-version +1 -1
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/lib/openapi3_parser/node/schema.rb +3 -1
- data/lib/openapi3_parser/node_factory/path_item.rb +1 -1
- data/lib/openapi3_parser/node_factory/paths.rb +1 -3
- data/lib/openapi3_parser/source/pointer.rb +2 -2
- data/lib/openapi3_parser/source/resolved_reference.rb +3 -7
- data/lib/openapi3_parser/validators/unexpected_fields.rb +1 -1
- data/lib/openapi3_parser/version.rb +1 -1
- data/openapi3_parser.gemspec +2 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5904884ad75e5d50acec8b37e27d4888ee903adab23998a78f884b4595e271dc
|
4
|
+
data.tar.gz: 8af9725d24ae912bac01b9be995be1d0105801cd245b7698508bb840b7e6da6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4edb5b8d4eec5c510ba62f58a2fb99b5156271548183d4dbc14039d17a0f14c504f466c359543cd871f8530d520e144ec03db1782fb8bcf6c006efb1434c6b45
|
7
|
+
data.tar.gz: 48f873eb9a0731fb8918b2015cb5263db8b9aeb0c6c24fe4e03e4d0d2be752f728efdecbff08064db915278e6862ad98f77259ed5a7d723e0f9c31cfd82debea
|
data/.github/workflows/ci.yml
CHANGED
@@ -3,7 +3,7 @@ jobs:
|
|
3
3
|
test:
|
4
4
|
strategy:
|
5
5
|
matrix:
|
6
|
-
ruby: [2.
|
6
|
+
ruby: [2.6, 2.7, 3.0, 3.1]
|
7
7
|
runs-on: ubuntu-latest
|
8
8
|
steps:
|
9
9
|
- uses: actions/checkout@v2
|
@@ -13,11 +13,11 @@ jobs:
|
|
13
13
|
ruby-version: ${{ matrix.ruby }}
|
14
14
|
- name: Test Ruby ${{ matrix.ruby }}
|
15
15
|
run: bundle exec rake
|
16
|
-
if: matrix.ruby != '2.
|
16
|
+
if: matrix.ruby != '2.6'
|
17
17
|
- name: Test and publish coverage for Ruby ${{ matrix.ruby }}
|
18
18
|
uses: paambaati/codeclimate-action@v2.7.5
|
19
19
|
env:
|
20
20
|
CC_TEST_REPORTER_ID: 8bc2d8e54331569aeb442094c21cb64a58d6efa0670f65ff00d9ae887f63c0b4
|
21
21
|
with:
|
22
22
|
coverageCommand: bundle exec rake
|
23
|
-
if: matrix.ruby == '2.
|
23
|
+
if: matrix.ruby == '2.6'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 0.9.1
|
2
|
+
|
3
|
+
- Fix Schema#requires? incorrectly returning true for referenced properties -
|
4
|
+
https://github.com/kevindew/openapi3_parser/issues/20
|
5
|
+
- Drop support for Ruby 2.5
|
6
|
+
|
1
7
|
# 0.9.0
|
2
8
|
|
3
9
|
- Fix unexpected fields error when using Example nodes inside a Parameter -
|
data/README.md
CHANGED
@@ -120,9 +120,11 @@ module Openapi3Parser
|
|
120
120
|
# @return [Boolean]
|
121
121
|
def requires?(property)
|
122
122
|
if property.is_a?(Schema)
|
123
|
+
# compare node_context of objects to ensure references aren't treated
|
124
|
+
# as equal - only direct properties of this object will pass.
|
123
125
|
properties.to_h
|
124
126
|
.select { |k, _| required.to_a.include?(k) }
|
125
|
-
.any? { |_, schema| schema == property }
|
127
|
+
.any? { |_, schema| schema.node_context == property.node_context }
|
126
128
|
else
|
127
129
|
required.to_a.include?(property)
|
128
130
|
end
|
@@ -36,9 +36,7 @@ module Openapi3Parser
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def validate(validatable)
|
39
|
-
paths = validatable.input.keys.
|
40
|
-
NodeFactory::EXTENSION_REGEX =~ key
|
41
|
-
end
|
39
|
+
paths = validatable.input.keys.grep_v(NodeFactory::EXTENSION_REGEX)
|
42
40
|
validate_paths(validatable, paths)
|
43
41
|
end
|
44
42
|
|
@@ -8,7 +8,7 @@ module Openapi3Parser
|
|
8
8
|
# provide common means to convert it into different representations.
|
9
9
|
class Pointer
|
10
10
|
def self.from_fragment(fragment)
|
11
|
-
fragment = fragment[1
|
11
|
+
fragment = fragment[1..] if fragment.start_with?("#")
|
12
12
|
absolute = fragment[0] == "/"
|
13
13
|
segments = fragment.split("/").map do |part|
|
14
14
|
next if part == ""
|
@@ -93,7 +93,7 @@ module Openapi3Parser
|
|
93
93
|
|
94
94
|
joined = File.expand_path("/#{fragment_a}/#{fragment_b}", "/")
|
95
95
|
|
96
|
-
joined = joined[1
|
96
|
+
joined = joined[1..] unless pointer_a.absolute
|
97
97
|
|
98
98
|
Pointer.from_fragment("##{joined}")
|
99
99
|
end
|
@@ -29,13 +29,9 @@ module Openapi3Parser
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def factory
|
32
|
-
@factory ||=
|
33
|
-
|
34
|
-
|
35
|
-
.tap do |factory|
|
36
|
-
message = "Unregistered node factory at #{source_location}"
|
37
|
-
raise Openapi3Parser::Error, message unless factory
|
38
|
-
end
|
32
|
+
@factory ||= reference_registry.factory(object_type, source_location).tap do |factory|
|
33
|
+
message = "Unregistered node factory at #{source_location}"
|
34
|
+
raise Openapi3Parser::Error, message unless factory
|
39
35
|
end
|
40
36
|
end
|
41
37
|
|
data/openapi3_parser.gemspec
CHANGED
@@ -10,6 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.version = Openapi3Parser::VERSION
|
11
11
|
spec.author = "Kevin Dew"
|
12
12
|
spec.email = "kevindew@me.com"
|
13
|
+
spec.metadata = { "rubygems_mfa_required" => "true" }
|
13
14
|
|
14
15
|
spec.summary = "An OpenAPI V3 parser for Ruby"
|
15
16
|
spec.description = <<-DESCRIPTION
|
@@ -24,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
24
25
|
f.match(%r{^spec/})
|
25
26
|
end
|
26
27
|
|
27
|
-
spec.required_ruby_version = ">= 2.
|
28
|
+
spec.required_ruby_version = ">= 2.6.0"
|
28
29
|
|
29
30
|
spec.add_dependency "commonmarker", "~> 0.17"
|
30
31
|
spec.add_dependency "psych", "~> 3.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openapi3_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Dew
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commonmarker
|
@@ -300,7 +300,8 @@ files:
|
|
300
300
|
homepage: https://github.com/kevindew/openapi_parser
|
301
301
|
licenses:
|
302
302
|
- MIT
|
303
|
-
metadata:
|
303
|
+
metadata:
|
304
|
+
rubygems_mfa_required: 'true'
|
304
305
|
post_install_message:
|
305
306
|
rdoc_options: []
|
306
307
|
require_paths:
|
@@ -309,15 +310,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
309
310
|
requirements:
|
310
311
|
- - ">="
|
311
312
|
- !ruby/object:Gem::Version
|
312
|
-
version: 2.
|
313
|
+
version: 2.6.0
|
313
314
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
314
315
|
requirements:
|
315
316
|
- - ">="
|
316
317
|
- !ruby/object:Gem::Version
|
317
318
|
version: '0'
|
318
319
|
requirements: []
|
319
|
-
|
320
|
-
rubygems_version: 2.7.6.2
|
320
|
+
rubygems_version: 3.0.3.1
|
321
321
|
signing_key:
|
322
322
|
specification_version: 4
|
323
323
|
summary: An OpenAPI V3 parser for Ruby
|