openapi3_parser 0.8.2 → 0.9.2
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 +5 -5
- data/.github/workflows/ci.yml +23 -0
- data/.rubocop.yml +18 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +16 -0
- data/README.md +4 -4
- data/lib/openapi3_parser/array_sentence.rb +1 -1
- data/lib/openapi3_parser/error.rb +11 -1
- data/lib/openapi3_parser/node/context.rb +1 -3
- data/lib/openapi3_parser/node/placeholder.rb +8 -7
- data/lib/openapi3_parser/node/schema.rb +3 -1
- data/lib/openapi3_parser/node_factory/map.rb +6 -6
- data/lib/openapi3_parser/node_factory/object_factory/dsl.rb +6 -4
- data/lib/openapi3_parser/node_factory/object_factory/field_config.rb +8 -7
- data/lib/openapi3_parser/node_factory/object_factory/node_builder.rb +11 -13
- data/lib/openapi3_parser/node_factory/object_factory/validator.rb +19 -17
- data/lib/openapi3_parser/node_factory/operation.rb +1 -3
- data/lib/openapi3_parser/node_factory/parameter_like.rb +1 -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/node_factory/reference.rb +1 -1
- data/lib/openapi3_parser/node_factory/request_body.rb +2 -4
- data/lib/openapi3_parser/source/pointer.rb +6 -6
- data/lib/openapi3_parser/source/resolved_reference.rb +3 -7
- data/lib/openapi3_parser/source_input/file.rb +1 -1
- data/lib/openapi3_parser/source_input/raw.rb +1 -1
- data/lib/openapi3_parser/source_input/url.rb +1 -1
- data/lib/openapi3_parser/source_input.rb +8 -10
- data/lib/openapi3_parser/validation/error_collection.rb +1 -1
- data/lib/openapi3_parser/validation/input_validator.rb +1 -1
- data/lib/openapi3_parser/validators/component_keys.rb +1 -1
- data/lib/openapi3_parser/validators/email.rb +2 -2
- data/lib/openapi3_parser/validators/mutually_exclusive_fields.rb +6 -6
- data/lib/openapi3_parser/validators/unexpected_fields.rb +1 -1
- data/lib/openapi3_parser/validators/url.rb +2 -7
- data/lib/openapi3_parser/version.rb +1 -1
- data/openapi3_parser.gemspec +7 -5
- metadata +40 -26
- data/.travis.yml +0 -22
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 235f373ec4962d88f12123599e593440027d21029afb5b234689a9b5a452b25f
|
|
4
|
+
data.tar.gz: 34bb8ef23dda618a8d8e00b7bb50c6192ff64725e3c7c7cc31d91c41bc30ecdd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5fa9a10c3bec7fd12478cd18afbb89125a05078e8234b2112af93c8fbedc0b3b7e51f7adcd8d25737af9df6692ec135f1a3034fe8b89bbcfd35acb5b8348515e
|
|
7
|
+
data.tar.gz: 6ee1b372abe88a4931d1dd294a7c125da5c88d98c21c383264c3d47aa323bb5a2fc3fffae8e8966eb357085b89797cfc9bad5510cdf983f2c3ad6b11d63cf2ff
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
on: [push, pull_request]
|
|
2
|
+
jobs:
|
|
3
|
+
test:
|
|
4
|
+
strategy:
|
|
5
|
+
matrix:
|
|
6
|
+
ruby: [2.6, 2.7, 3.0, 3.1]
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v2
|
|
10
|
+
- uses: ruby/setup-ruby@v1
|
|
11
|
+
with:
|
|
12
|
+
bundler-cache: true
|
|
13
|
+
ruby-version: ${{ matrix.ruby }}
|
|
14
|
+
- name: Test Ruby ${{ matrix.ruby }}
|
|
15
|
+
run: bundle exec rake
|
|
16
|
+
if: matrix.ruby != '2.6'
|
|
17
|
+
- name: Test and publish coverage for Ruby ${{ matrix.ruby }}
|
|
18
|
+
uses: paambaati/codeclimate-action@v2.7.5
|
|
19
|
+
env:
|
|
20
|
+
CC_TEST_REPORTER_ID: 8bc2d8e54331569aeb442094c21cb64a58d6efa0670f65ff00d9ae887f63c0b4
|
|
21
|
+
with:
|
|
22
|
+
coverageCommand: bundle exec rake
|
|
23
|
+
if: matrix.ruby == '2.6'
|
data/.rubocop.yml
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
|
+
require:
|
|
2
|
+
- rubocop-rake
|
|
3
|
+
- rubocop-rspec
|
|
4
|
+
AllCops:
|
|
5
|
+
NewCops: enable
|
|
1
6
|
Style/StringLiterals:
|
|
2
7
|
EnforcedStyle: double_quotes
|
|
3
8
|
Metrics/MethodLength:
|
|
4
9
|
Max: 30
|
|
5
10
|
Metrics/AbcSize:
|
|
6
11
|
Max: 30
|
|
12
|
+
RSpec/ExampleLength:
|
|
13
|
+
Max: 30
|
|
7
14
|
Style/Documentation:
|
|
8
15
|
Enabled: false
|
|
9
16
|
Metrics/BlockLength:
|
|
10
17
|
Exclude:
|
|
11
18
|
- 'spec/**/*.rb'
|
|
12
|
-
|
|
19
|
+
- '*.gemspec'
|
|
20
|
+
RSpec/DescribeClass:
|
|
21
|
+
Exclude:
|
|
22
|
+
- 'spec/integration/**/*.rb'
|
|
23
|
+
# I'd rather have multiple expectations than lots of duplicate tests
|
|
24
|
+
RSpec/MultipleExpectations:
|
|
25
|
+
Enabled: false
|
|
26
|
+
# The default arbitrary number (5) is a little painful
|
|
27
|
+
RSpec/MultipleMemoizedHelpers:
|
|
28
|
+
Enabled: false
|
|
29
|
+
RSpec/MessageSpies:
|
|
13
30
|
Enabled: false
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.6.9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# 0.9.2
|
|
2
|
+
|
|
3
|
+
- No longer require a specific Psych dependency to instead use Ruby stdlib
|
|
4
|
+
|
|
5
|
+
# 0.9.1
|
|
6
|
+
|
|
7
|
+
- Fix Schema#requires? incorrectly returning true for referenced properties -
|
|
8
|
+
https://github.com/kevindew/openapi3_parser/issues/20
|
|
9
|
+
- Drop support for Ruby 2.5
|
|
10
|
+
|
|
11
|
+
# 0.9.0
|
|
12
|
+
|
|
13
|
+
- Fix unexpected fields error when using Example nodes inside a Parameter -
|
|
14
|
+
https://github.com/kevindew/openapi3_parser/pull/19
|
|
15
|
+
- Drop support for Ruby 2.4
|
|
16
|
+
|
|
1
17
|
# 0.8.2
|
|
2
18
|
|
|
3
19
|
- Fix bug falling into recursive loop on Array/Map nodes -
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OpenAPI 3 Parser
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/kevindew/openapi3_parser)
|
|
4
4
|
|
|
5
5
|
This a Ruby based parser/validator for [OpenAPI 3][openapi-3]. It is used to
|
|
6
6
|
convert an OpenAPI file (can be a local file, a URL, a string or even a Ruby
|
|
@@ -47,7 +47,7 @@ parser in [How to write an OpenAPI 3 parser][blog].
|
|
|
47
47
|
|
|
48
48
|
```ruby
|
|
49
49
|
# by URL
|
|
50
|
-
Openapi3Parser.load_url("https://raw.githubusercontent.com/kevindew/openapi3_parser/
|
|
50
|
+
Openapi3Parser.load_url("https://raw.githubusercontent.com/kevindew/openapi3_parser/main/spec/support/examples/petstore-expanded.yaml")
|
|
51
51
|
|
|
52
52
|
# by path to file
|
|
53
53
|
Openapi3Parser.load_file("spec/support/examples/uber.yaml")
|
|
@@ -76,7 +76,7 @@ document.errors
|
|
|
76
76
|
### Traversing
|
|
77
77
|
|
|
78
78
|
```ruby
|
|
79
|
-
document = Openapi3Parser.load_url("https://raw.githubusercontent.com/kevindew/openapi3_parser/
|
|
79
|
+
document = Openapi3Parser.load_url("https://raw.githubusercontent.com/kevindew/openapi3_parser/main/spec/support/examples/petstore-expanded.yaml")
|
|
80
80
|
|
|
81
81
|
# by objects
|
|
82
82
|
|
|
@@ -121,7 +121,7 @@ You can install this gem into your bundler application by adding this line to
|
|
|
121
121
|
your Gemfile:
|
|
122
122
|
|
|
123
123
|
```
|
|
124
|
-
gem "openapi3_parser", "~> 0.
|
|
124
|
+
gem "openapi3_parser", "~> 0.9.0"
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
and then running `$ bundle install`
|
|
@@ -7,32 +7,42 @@ module Openapi3Parser
|
|
|
7
7
|
# at runtime when we have tried to access that resource it is not available
|
|
8
8
|
# for whatever reason.
|
|
9
9
|
class InaccessibleInput < Error; end
|
|
10
|
+
|
|
10
11
|
# Raised in cases where we provided data that we expected to be parsable
|
|
11
12
|
# (such as a string of JSON data) but when we tried to parse it an error
|
|
12
13
|
# is raised
|
|
13
14
|
class UnparsableInput < Error; end
|
|
15
|
+
|
|
14
16
|
# Raised in cases where an object that is in an immutable state is modified
|
|
15
17
|
#
|
|
16
18
|
# Typically this would occur when a component that is frozen is modififed.
|
|
17
19
|
# Some components are mutable during the construction of a document and
|
|
18
20
|
# then frozen afterwards.
|
|
19
21
|
class ImmutableObject < Error; end
|
|
20
|
-
|
|
22
|
+
|
|
23
|
+
# Raised when a node is provided data as a type that is outside the allowed
|
|
24
|
+
# list
|
|
21
25
|
class InvalidType < Error; end
|
|
26
|
+
|
|
22
27
|
# Raised when we have to abort creating an object due to invalid data
|
|
23
28
|
class InvalidData < Error; end
|
|
29
|
+
|
|
24
30
|
# Used when there are fields that are missing from an object which prevents
|
|
25
31
|
# us from creating a node
|
|
26
32
|
class MissingFields < Error; end
|
|
33
|
+
|
|
27
34
|
# Used when there are extra fields that are not expected in the data for
|
|
28
35
|
# a node
|
|
29
36
|
class UnexpectedFields < Error; end
|
|
37
|
+
|
|
30
38
|
# Used when a method we expect to be able to call (through symbol or proc)
|
|
31
39
|
# is not callable
|
|
32
40
|
class NotCallable < Error; end
|
|
41
|
+
|
|
33
42
|
# Raised when we in a recursive data structure and can't perform an
|
|
34
43
|
# operation
|
|
35
44
|
class InRecursiveStructure < Error; end
|
|
45
|
+
|
|
36
46
|
# Used when we're trying to validate that a type is something that is not
|
|
37
47
|
# validatable, most likely a sign that we're in a bug
|
|
38
48
|
class UnvalidatableType < Error; end
|
|
@@ -107,9 +107,7 @@ module Openapi3Parser
|
|
|
107
107
|
def location_summary
|
|
108
108
|
summary = document_location.to_s
|
|
109
109
|
|
|
110
|
-
if document_location != source_location
|
|
111
|
-
summary += " (#{source_location})"
|
|
112
|
-
end
|
|
110
|
+
summary += " (#{source_location})" if document_location != source_location
|
|
113
111
|
|
|
114
112
|
summary
|
|
115
113
|
end
|
|
@@ -21,8 +21,8 @@ module Openapi3Parser
|
|
|
21
21
|
def self.each(node_data, &block)
|
|
22
22
|
resolved =
|
|
23
23
|
if node_data.respond_to?(:keys)
|
|
24
|
-
node_data.
|
|
25
|
-
|
|
24
|
+
node_data.transform_values do |value|
|
|
25
|
+
resolve(value)
|
|
26
26
|
end
|
|
27
27
|
else
|
|
28
28
|
node_data.map { |item| resolve(item) }
|
|
@@ -32,6 +32,7 @@ module Openapi3Parser
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
attr_reader :node_factory, :field, :parent_context
|
|
35
|
+
|
|
35
36
|
def_delegators :node_factory, :nil_input?
|
|
36
37
|
|
|
37
38
|
def initialize(node_factory, field, parent_context)
|
|
@@ -42,11 +43,11 @@ module Openapi3Parser
|
|
|
42
43
|
|
|
43
44
|
def node
|
|
44
45
|
@node ||= begin
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
node_context = Context.next_field(parent_context,
|
|
47
|
+
field,
|
|
48
|
+
node_factory.context)
|
|
49
|
+
node_factory.node(node_context)
|
|
50
|
+
end
|
|
50
51
|
end
|
|
51
52
|
end
|
|
52
53
|
end
|
|
@@ -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
|
|
@@ -90,12 +90,12 @@ module Openapi3Parser
|
|
|
90
90
|
def build_resolved_input
|
|
91
91
|
return unless data
|
|
92
92
|
|
|
93
|
-
data.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
data.transform_values do |value|
|
|
94
|
+
if value.respond_to?(:resolved_input)
|
|
95
|
+
value.resolved_input
|
|
96
|
+
else
|
|
97
|
+
value
|
|
98
|
+
end
|
|
99
99
|
end
|
|
100
100
|
end
|
|
101
101
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "ostruct"
|
|
4
3
|
require "openapi3_parser/node_factory/object_factory/field_config"
|
|
5
4
|
|
|
6
5
|
module Openapi3Parser
|
|
7
6
|
module NodeFactory
|
|
8
7
|
module ObjectFactory
|
|
9
8
|
module Dsl
|
|
9
|
+
MutuallyExclusiveField = Struct.new(:fields, :required, keyword_init: true)
|
|
10
|
+
|
|
10
11
|
def field(name, **options)
|
|
11
12
|
@field_configs ||= {}
|
|
12
13
|
@field_configs[name] = FieldConfig.new(**options)
|
|
@@ -30,8 +31,9 @@ module Openapi3Parser
|
|
|
30
31
|
|
|
31
32
|
def mutually_exclusive(*fields, required: false)
|
|
32
33
|
@mutually_exclusive_fields ||= []
|
|
33
|
-
@mutually_exclusive_fields <<
|
|
34
|
-
fields: fields,
|
|
34
|
+
@mutually_exclusive_fields << MutuallyExclusiveField.new(
|
|
35
|
+
fields: fields,
|
|
36
|
+
required: required
|
|
35
37
|
)
|
|
36
38
|
end
|
|
37
39
|
|
|
@@ -41,7 +43,7 @@ module Openapi3Parser
|
|
|
41
43
|
|
|
42
44
|
def validate(*items, &block)
|
|
43
45
|
@validations ||= []
|
|
44
|
-
@validations
|
|
46
|
+
@validations.concat(items)
|
|
45
47
|
@validations << block if block
|
|
46
48
|
end
|
|
47
49
|
|
|
@@ -22,10 +22,11 @@ module Openapi3Parser
|
|
|
22
22
|
!given_factory.nil?
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
-
def initialize_factory(context, parent_factory)
|
|
26
|
-
|
|
25
|
+
def initialize_factory(context, parent_factory = nil)
|
|
26
|
+
case given_factory
|
|
27
|
+
when Class
|
|
27
28
|
given_factory.new(context)
|
|
28
|
-
|
|
29
|
+
when Symbol
|
|
29
30
|
parent_factory.send(given_factory, context)
|
|
30
31
|
else
|
|
31
32
|
given_factory.call(context)
|
|
@@ -36,7 +37,7 @@ module Openapi3Parser
|
|
|
36
37
|
given_required
|
|
37
38
|
end
|
|
38
39
|
|
|
39
|
-
def check_input_type(validatable, building_node)
|
|
40
|
+
def check_input_type(validatable, building_node: false)
|
|
40
41
|
return true if !given_input_type || validatable.input.nil?
|
|
41
42
|
|
|
42
43
|
if building_node
|
|
@@ -47,7 +48,7 @@ module Openapi3Parser
|
|
|
47
48
|
end
|
|
48
49
|
end
|
|
49
50
|
|
|
50
|
-
def validate_field(validatable, building_node)
|
|
51
|
+
def validate_field(validatable, building_node: false)
|
|
51
52
|
return true if !given_validate || validatable.input.nil?
|
|
52
53
|
|
|
53
54
|
run_validation(validatable)
|
|
@@ -61,9 +62,9 @@ module Openapi3Parser
|
|
|
61
62
|
"Invalid data for #{location_summary}: #{error.message}"
|
|
62
63
|
end
|
|
63
64
|
|
|
64
|
-
def default(factory)
|
|
65
|
+
def default(factory = nil)
|
|
65
66
|
return given_default.call if given_default.is_a?(Proc)
|
|
66
|
-
return factory
|
|
67
|
+
return factory&.send(given_default) if given_default.is_a?(Symbol)
|
|
67
68
|
|
|
68
69
|
given_default
|
|
69
70
|
end
|
|
@@ -8,8 +8,8 @@ module Openapi3Parser
|
|
|
8
8
|
new(factory).errors
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
def self.node_data(factory,
|
|
12
|
-
new(factory).node_data(
|
|
11
|
+
def self.node_data(factory, node_context)
|
|
12
|
+
new(factory).node_data(node_context)
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def initialize(factory)
|
|
@@ -22,19 +22,17 @@ module Openapi3Parser
|
|
|
22
22
|
|
|
23
23
|
TypeChecker.validate_type(validatable, type: ::Hash)
|
|
24
24
|
|
|
25
|
-
if validatable.errors.empty?
|
|
26
|
-
validatable.add_errors(validate(raise_on_invalid: false))
|
|
27
|
-
end
|
|
25
|
+
validatable.add_errors(validate(raise_on_invalid: false)) if validatable.errors.empty?
|
|
28
26
|
|
|
29
27
|
validatable.collection
|
|
30
28
|
end
|
|
31
29
|
|
|
32
|
-
def node_data(
|
|
33
|
-
return build_node_data(
|
|
30
|
+
def node_data(node_context)
|
|
31
|
+
return build_node_data(node_context) if empty_and_allowed_to_be?
|
|
34
32
|
|
|
35
33
|
TypeChecker.raise_on_invalid_type(factory.context, type: ::Hash)
|
|
36
34
|
validate(raise_on_invalid: true)
|
|
37
|
-
build_node_data(
|
|
35
|
+
build_node_data(node_context)
|
|
38
36
|
end
|
|
39
37
|
|
|
40
38
|
private_class_method :new
|
|
@@ -48,22 +46,22 @@ module Openapi3Parser
|
|
|
48
46
|
end
|
|
49
47
|
|
|
50
48
|
def validate(raise_on_invalid:)
|
|
51
|
-
Validator.call(factory, raise_on_invalid)
|
|
49
|
+
Validator.call(factory, raise_on_invalid: raise_on_invalid)
|
|
52
50
|
end
|
|
53
51
|
|
|
54
|
-
def build_node_data(
|
|
52
|
+
def build_node_data(node_context)
|
|
55
53
|
return if factory.nil_input? && factory.data.nil?
|
|
56
54
|
|
|
57
55
|
factory.data.each_with_object({}) do |(key, value), memo|
|
|
58
|
-
memo[key] = resolve_value(key, value,
|
|
56
|
+
memo[key] = resolve_value(key, value, node_context)
|
|
59
57
|
end
|
|
60
58
|
end
|
|
61
59
|
|
|
62
|
-
def resolve_value(key, value,
|
|
60
|
+
def resolve_value(key, value, node_context)
|
|
63
61
|
resolved = determine_value_or_default(key, value)
|
|
64
62
|
|
|
65
63
|
if resolved.respond_to?(:node)
|
|
66
|
-
Node::Placeholder.new(value, key,
|
|
64
|
+
Node::Placeholder.new(value, key, node_context)
|
|
67
65
|
else
|
|
68
66
|
resolved
|
|
69
67
|
end
|
|
@@ -7,15 +7,15 @@ module Openapi3Parser
|
|
|
7
7
|
module ObjectFactory
|
|
8
8
|
class Validator
|
|
9
9
|
private_class_method :new
|
|
10
|
-
attr_reader :factory, :validatable, :
|
|
10
|
+
attr_reader :factory, :validatable, :raise_on_invalid
|
|
11
11
|
|
|
12
|
-
def self.call(*args)
|
|
13
|
-
new(*args).call
|
|
12
|
+
def self.call(*args, **kwargs)
|
|
13
|
+
new(*args, **kwargs).call
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
def initialize(factory,
|
|
16
|
+
def initialize(factory, raise_on_invalid: false)
|
|
17
17
|
@factory = factory
|
|
18
|
-
@
|
|
18
|
+
@raise_on_invalid = raise_on_invalid
|
|
19
19
|
@validatable = Validation::Validatable.new(factory)
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -34,7 +34,7 @@ module Openapi3Parser
|
|
|
34
34
|
Validators::RequiredFields.call(
|
|
35
35
|
validatable,
|
|
36
36
|
required_fields: factory.required_fields,
|
|
37
|
-
raise_on_invalid:
|
|
37
|
+
raise_on_invalid: raise_on_invalid
|
|
38
38
|
)
|
|
39
39
|
end
|
|
40
40
|
|
|
@@ -43,7 +43,7 @@ module Openapi3Parser
|
|
|
43
43
|
validatable,
|
|
44
44
|
allow_extensions: factory.allowed_extensions?,
|
|
45
45
|
allowed_fields: factory.allowed_fields,
|
|
46
|
-
raise_on_invalid:
|
|
46
|
+
raise_on_invalid: raise_on_invalid
|
|
47
47
|
)
|
|
48
48
|
end
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ module Openapi3Parser
|
|
|
51
51
|
Validators::MutuallyExclusiveFields.call(
|
|
52
52
|
validatable,
|
|
53
53
|
mutually_exclusive_fields: factory.mutually_exclusive_fields,
|
|
54
|
-
raise_on_invalid:
|
|
54
|
+
raise_on_invalid: raise_on_invalid
|
|
55
55
|
)
|
|
56
56
|
end
|
|
57
57
|
|
|
@@ -66,7 +66,8 @@ module Openapi3Parser
|
|
|
66
66
|
class CheckInvalidFields
|
|
67
67
|
extend Forwardable
|
|
68
68
|
attr_reader :validator
|
|
69
|
-
|
|
69
|
+
|
|
70
|
+
def_delegators :validator, :factory, :raise_on_invalid, :validatable
|
|
70
71
|
private_class_method :new
|
|
71
72
|
|
|
72
73
|
def self.call(validator)
|
|
@@ -88,16 +89,14 @@ module Openapi3Parser
|
|
|
88
89
|
|
|
89
90
|
# We don't add errors when we're building a node as they will
|
|
90
91
|
# be raised when that child node is built
|
|
91
|
-
validatable.add_errors(field.errors) unless
|
|
92
|
+
validatable.add_errors(field.errors) unless raise_on_invalid
|
|
92
93
|
end
|
|
93
94
|
end
|
|
94
95
|
|
|
95
96
|
private
|
|
96
97
|
|
|
97
98
|
def handle_factory_checks(name)
|
|
98
|
-
field_errors = if factory.field_configs[name]
|
|
99
|
-
check_field(name, factory.field_configs[name])
|
|
100
|
-
end
|
|
99
|
+
field_errors = (check_field(name, factory.field_configs[name]) if factory.field_configs[name])
|
|
101
100
|
|
|
102
101
|
(field_errors || []).any?
|
|
103
102
|
end
|
|
@@ -115,11 +114,14 @@ module Openapi3Parser
|
|
|
115
114
|
field_validatable = Validation::Validatable.new(factory,
|
|
116
115
|
context: context)
|
|
117
116
|
|
|
118
|
-
valid_input_type = field_config.check_input_type(
|
|
119
|
-
|
|
117
|
+
valid_input_type = field_config.check_input_type(
|
|
118
|
+
field_validatable,
|
|
119
|
+
building_node: raise_on_invalid
|
|
120
|
+
)
|
|
120
121
|
|
|
121
122
|
if valid_input_type
|
|
122
|
-
field_config.validate_field(field_validatable,
|
|
123
|
+
field_config.validate_field(field_validatable,
|
|
124
|
+
building_node: raise_on_invalid)
|
|
123
125
|
end
|
|
124
126
|
|
|
125
127
|
validatable.add_errors(field_validatable.errors)
|
|
@@ -139,7 +141,7 @@ module Openapi3Parser
|
|
|
139
141
|
|
|
140
142
|
errors = validator.validatable.errors
|
|
141
143
|
|
|
142
|
-
return if errors.empty? || !validator.
|
|
144
|
+
return if errors.empty? || !validator.raise_on_invalid
|
|
143
145
|
|
|
144
146
|
location_summary = errors.first.context.location_summary
|
|
145
147
|
raise Error::InvalidData,
|
|
@@ -25,9 +25,7 @@ module Openapi3Parser
|
|
|
25
25
|
private
|
|
26
26
|
|
|
27
27
|
def build_object(data, context)
|
|
28
|
-
if data["servers"].node.empty?
|
|
29
|
-
data["servers"] = path_item_server_data(context)
|
|
30
|
-
end
|
|
28
|
+
data["servers"] = path_item_server_data(context) if data["servers"].node.empty?
|
|
31
29
|
|
|
32
30
|
Node::Operation.new(data, context)
|
|
33
31
|
end
|
|
@@ -13,7 +13,7 @@ module Openapi3Parser
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def examples_factory(context)
|
|
16
|
-
factory = NodeFactory::OptionalReference.new(NodeFactory::
|
|
16
|
+
factory = NodeFactory::OptionalReference.new(NodeFactory::Example)
|
|
17
17
|
NodeFactory::Map.new(context,
|
|
18
18
|
default: nil,
|
|
19
19
|
value_factory: factory)
|
|
@@ -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
|
|
|
@@ -44,7 +44,7 @@ module Openapi3Parser
|
|
|
44
44
|
|
|
45
45
|
def build_node(node_context)
|
|
46
46
|
TypeChecker.raise_on_invalid_type(context, type: ::Hash)
|
|
47
|
-
ObjectFactory::Validator.call(self, true)
|
|
47
|
+
ObjectFactory::Validator.call(self, raise_on_invalid: true)
|
|
48
48
|
data["$ref"].node(node_context)
|
|
49
49
|
end
|
|
50
50
|
|
|
@@ -32,11 +32,9 @@ module Openapi3Parser
|
|
|
32
32
|
def call(validatable)
|
|
33
33
|
# This validation isn't actually mentioned in the spec, but it
|
|
34
34
|
# doesn't seem to make sense if this is an empty hash.
|
|
35
|
-
if validatable.input.size.zero?
|
|
36
|
-
return validatable.add_error("Expected to have at least 1 item")
|
|
37
|
-
end
|
|
35
|
+
return validatable.add_error("Expected to have at least 1 item") if validatable.input.size.zero?
|
|
38
36
|
|
|
39
|
-
validatable.input.
|
|
37
|
+
validatable.input.each_key do |key|
|
|
40
38
|
message = Validators::MediaType.call(key)
|
|
41
39
|
next unless message
|
|
42
40
|
|
|
@@ -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 == ""
|
|
@@ -16,7 +16,7 @@ module Openapi3Parser
|
|
|
16
16
|
unescaped = CGI.unescape(part.gsub("%20", "+"))
|
|
17
17
|
unescaped.match?(/\A\d+\z/) ? unescaped.to_i : unescaped
|
|
18
18
|
end
|
|
19
|
-
new(segments.compact, absolute)
|
|
19
|
+
new(segments.compact, absolute: absolute)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def self.merge_pointers(base_pointer, new_pointer)
|
|
@@ -27,7 +27,7 @@ module Openapi3Parser
|
|
|
27
27
|
|
|
28
28
|
# @param [::Array] segments
|
|
29
29
|
# @param [Boolean] absolute
|
|
30
|
-
def initialize(segments, absolute
|
|
30
|
+
def initialize(segments, absolute: true)
|
|
31
31
|
@segments = segments.freeze
|
|
32
32
|
@absolute = absolute
|
|
33
33
|
end
|
|
@@ -39,7 +39,7 @@ module Openapi3Parser
|
|
|
39
39
|
def fragment
|
|
40
40
|
fragment = segments.map { |s| CGI.escape(s.to_s).gsub("+", "%20") }
|
|
41
41
|
.join("/")
|
|
42
|
-
"
|
|
42
|
+
"##{absolute ? fragment.prepend('/') : fragment}"
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def to_s
|
|
@@ -80,7 +80,7 @@ module Openapi3Parser
|
|
|
80
80
|
def create_pointer(pointer_like)
|
|
81
81
|
case pointer_like
|
|
82
82
|
when Pointer then pointer_like
|
|
83
|
-
when ::Array then Pointer.new(pointer_like, false)
|
|
83
|
+
when ::Array then Pointer.new(pointer_like, absolute: false)
|
|
84
84
|
when ::String then Pointer.from_fragment(pointer_like)
|
|
85
85
|
when nil then nil
|
|
86
86
|
else raise Openapi3Parser::Error, "Unexpected type for pointer"
|
|
@@ -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
|
|
|
@@ -20,6 +20,14 @@ module Openapi3Parser
|
|
|
20
20
|
class SourceInput
|
|
21
21
|
attr_reader :access_error, :parse_error
|
|
22
22
|
|
|
23
|
+
def initialize
|
|
24
|
+
return if access_error
|
|
25
|
+
|
|
26
|
+
@contents = parse_contents
|
|
27
|
+
rescue ::StandardError => e
|
|
28
|
+
@parse_error = Error::UnparsableInput.new(e.message)
|
|
29
|
+
end
|
|
30
|
+
|
|
23
31
|
# Indicates that the data within this input is suitable (i.e. can parse
|
|
24
32
|
# underlying JSON or YAML) for trying to use as part of a Document
|
|
25
33
|
def available?
|
|
@@ -57,15 +65,5 @@ module Openapi3Parser
|
|
|
57
65
|
def relative_to(_source_input)
|
|
58
66
|
""
|
|
59
67
|
end
|
|
60
|
-
|
|
61
|
-
private
|
|
62
|
-
|
|
63
|
-
def initialize_contents
|
|
64
|
-
return if access_error
|
|
65
|
-
|
|
66
|
-
@contents = parse_contents
|
|
67
|
-
rescue ::StandardError => e
|
|
68
|
-
@parse_error = Error::UnparsableInput.new(e.message)
|
|
69
|
-
end
|
|
70
68
|
end
|
|
71
69
|
end
|
|
@@ -56,7 +56,7 @@ module Openapi3Parser
|
|
|
56
56
|
grouped.each_with_object({}) do |(_, items), memo|
|
|
57
57
|
items.each do |item|
|
|
58
58
|
key = item.location_summary(with_type: items.count > 1)
|
|
59
|
-
memo[key] = (
|
|
59
|
+
memo[key] = memo.fetch(key, []) + item.errors.map(&:to_s)
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
end
|
|
@@ -6,7 +6,7 @@ module Openapi3Parser
|
|
|
6
6
|
# defined for a Components node.
|
|
7
7
|
# As defined: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#components-object
|
|
8
8
|
class ComponentKeys
|
|
9
|
-
REGEX = /\A[a-zA-Z0-9
|
|
9
|
+
REGEX = /\A[a-zA-Z0-9.\-_]+\Z/.freeze
|
|
10
10
|
|
|
11
11
|
def self.call(input)
|
|
12
12
|
invalid = input.keys.reject { |key| REGEX.match(key) }
|
|
@@ -7,10 +7,10 @@ module Openapi3Parser
|
|
|
7
7
|
# https://html.spec.whatwg.org/#e-mail-state-(type=email)
|
|
8
8
|
REGEX = %r{
|
|
9
9
|
\A
|
|
10
|
-
[a-zA-Z0-9.!#$%&'
|
|
10
|
+
[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+
|
|
11
11
|
@
|
|
12
12
|
[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?
|
|
13
|
-
(
|
|
13
|
+
(?:.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*
|
|
14
14
|
\Z
|
|
15
15
|
}x.freeze
|
|
16
16
|
|
|
@@ -78,12 +78,12 @@ module Openapi3Parser
|
|
|
78
78
|
|
|
79
79
|
def errors
|
|
80
80
|
@errors ||= begin
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
81
|
+
default = { required: [], exclusive: [] }
|
|
82
|
+
mutually_exclusive_fields
|
|
83
|
+
.each_with_object(default) do |exclusive, errors|
|
|
84
|
+
add_error(errors, exclusive)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
87
|
end
|
|
88
88
|
|
|
89
89
|
private
|
|
@@ -4,14 +4,9 @@ module Openapi3Parser
|
|
|
4
4
|
module Validators
|
|
5
5
|
class Url
|
|
6
6
|
def self.call(input)
|
|
7
|
-
|
|
8
|
-
uri = URI.parse(input)
|
|
9
|
-
|
|
10
|
-
message if !uri.relative? &&
|
|
11
|
-
!uri.is_a?(URI::HTTP) &&
|
|
12
|
-
!uri.is_a?(URI::HTTPS)
|
|
7
|
+
URI.parse(input) && nil
|
|
13
8
|
rescue URI::InvalidURIError
|
|
14
|
-
|
|
9
|
+
%("#{input}" is not a valid URL)
|
|
15
10
|
end
|
|
16
11
|
end
|
|
17
12
|
end
|
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,16 +25,17 @@ 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
|
-
spec.add_dependency "psych", "~> 3.1"
|
|
31
31
|
|
|
32
32
|
spec.add_development_dependency "bundler"
|
|
33
33
|
spec.add_development_dependency "byebug", "~> 11.0"
|
|
34
|
-
spec.add_development_dependency "rake"
|
|
34
|
+
spec.add_development_dependency "rake"
|
|
35
35
|
spec.add_development_dependency "rspec", "~> 3.9"
|
|
36
|
-
spec.add_development_dependency "rubocop", "~>
|
|
37
|
-
spec.add_development_dependency "
|
|
36
|
+
spec.add_development_dependency "rubocop", "~> 1"
|
|
37
|
+
spec.add_development_dependency "rubocop-rake", "~> 0.5"
|
|
38
|
+
spec.add_development_dependency "rubocop-rspec", "~> 2"
|
|
39
|
+
spec.add_development_dependency "simplecov", "~> 0.19"
|
|
38
40
|
spec.add_development_dependency "webmock", "~> 3.8"
|
|
39
41
|
end
|
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.
|
|
4
|
+
version: 0.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kevin Dew
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-03-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: commonmarker
|
|
@@ -25,21 +25,35 @@ dependencies:
|
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '0.17'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: bundler
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: byebug
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
30
44
|
requirements:
|
|
31
45
|
- - "~>"
|
|
32
46
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
34
|
-
type: :
|
|
47
|
+
version: '11.0'
|
|
48
|
+
type: :development
|
|
35
49
|
prerelease: false
|
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
51
|
requirements:
|
|
38
52
|
- - "~>"
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
54
|
+
version: '11.0'
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
56
|
+
name: rake
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
44
58
|
requirements:
|
|
45
59
|
- - ">="
|
|
@@ -53,75 +67,75 @@ dependencies:
|
|
|
53
67
|
- !ruby/object:Gem::Version
|
|
54
68
|
version: '0'
|
|
55
69
|
- !ruby/object:Gem::Dependency
|
|
56
|
-
name:
|
|
70
|
+
name: rspec
|
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
|
58
72
|
requirements:
|
|
59
73
|
- - "~>"
|
|
60
74
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: '
|
|
75
|
+
version: '3.9'
|
|
62
76
|
type: :development
|
|
63
77
|
prerelease: false
|
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
79
|
requirements:
|
|
66
80
|
- - "~>"
|
|
67
81
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
82
|
+
version: '3.9'
|
|
69
83
|
- !ruby/object:Gem::Dependency
|
|
70
|
-
name:
|
|
84
|
+
name: rubocop
|
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
|
72
86
|
requirements:
|
|
73
87
|
- - "~>"
|
|
74
88
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
89
|
+
version: '1'
|
|
76
90
|
type: :development
|
|
77
91
|
prerelease: false
|
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
93
|
requirements:
|
|
80
94
|
- - "~>"
|
|
81
95
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: '
|
|
96
|
+
version: '1'
|
|
83
97
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name:
|
|
98
|
+
name: rubocop-rake
|
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
|
86
100
|
requirements:
|
|
87
101
|
- - "~>"
|
|
88
102
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: '
|
|
103
|
+
version: '0.5'
|
|
90
104
|
type: :development
|
|
91
105
|
prerelease: false
|
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
107
|
requirements:
|
|
94
108
|
- - "~>"
|
|
95
109
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '
|
|
110
|
+
version: '0.5'
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: rubocop
|
|
112
|
+
name: rubocop-rspec
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
100
114
|
requirements:
|
|
101
115
|
- - "~>"
|
|
102
116
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
117
|
+
version: '2'
|
|
104
118
|
type: :development
|
|
105
119
|
prerelease: false
|
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
121
|
requirements:
|
|
108
122
|
- - "~>"
|
|
109
123
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
124
|
+
version: '2'
|
|
111
125
|
- !ruby/object:Gem::Dependency
|
|
112
126
|
name: simplecov
|
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
|
114
128
|
requirements:
|
|
115
129
|
- - "~>"
|
|
116
130
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0.
|
|
131
|
+
version: '0.19'
|
|
118
132
|
type: :development
|
|
119
133
|
prerelease: false
|
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
135
|
requirements:
|
|
122
136
|
- - "~>"
|
|
123
137
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0.
|
|
138
|
+
version: '0.19'
|
|
125
139
|
- !ruby/object:Gem::Dependency
|
|
126
140
|
name: webmock
|
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -145,11 +159,11 @@ executables: []
|
|
|
145
159
|
extensions: []
|
|
146
160
|
extra_rdoc_files: []
|
|
147
161
|
files:
|
|
162
|
+
- ".github/workflows/ci.yml"
|
|
148
163
|
- ".gitignore"
|
|
149
164
|
- ".rspec"
|
|
150
165
|
- ".rubocop.yml"
|
|
151
166
|
- ".ruby-version"
|
|
152
|
-
- ".travis.yml"
|
|
153
167
|
- CHANGELOG.md
|
|
154
168
|
- Gemfile
|
|
155
169
|
- LICENCE
|
|
@@ -272,7 +286,8 @@ files:
|
|
|
272
286
|
homepage: https://github.com/kevindew/openapi_parser
|
|
273
287
|
licenses:
|
|
274
288
|
- MIT
|
|
275
|
-
metadata:
|
|
289
|
+
metadata:
|
|
290
|
+
rubygems_mfa_required: 'true'
|
|
276
291
|
post_install_message:
|
|
277
292
|
rdoc_options: []
|
|
278
293
|
require_paths:
|
|
@@ -281,15 +296,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
281
296
|
requirements:
|
|
282
297
|
- - ">="
|
|
283
298
|
- !ruby/object:Gem::Version
|
|
284
|
-
version: 2.
|
|
299
|
+
version: 2.6.0
|
|
285
300
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
286
301
|
requirements:
|
|
287
302
|
- - ">="
|
|
288
303
|
- !ruby/object:Gem::Version
|
|
289
304
|
version: '0'
|
|
290
305
|
requirements: []
|
|
291
|
-
|
|
292
|
-
rubygems_version: 2.6.14.4
|
|
306
|
+
rubygems_version: 3.0.3.1
|
|
293
307
|
signing_key:
|
|
294
308
|
specification_version: 4
|
|
295
309
|
summary: An OpenAPI V3 parser for Ruby
|
data/.travis.yml
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
sudo: false
|
|
3
|
-
env:
|
|
4
|
-
global:
|
|
5
|
-
CC_TEST_REPORTER_ID=8bc2d8e54331569aeb442094c21cb64a58d6efa0670f65ff00d9ae887f63c0b4
|
|
6
|
-
CC_RUBY_VERSION=ruby-2.4.6
|
|
7
|
-
rvm:
|
|
8
|
-
- 2.4.6
|
|
9
|
-
- 2.5.5
|
|
10
|
-
- 2.6.4
|
|
11
|
-
- 2.7.0
|
|
12
|
-
- ruby-head
|
|
13
|
-
matrix:
|
|
14
|
-
allow_failures:
|
|
15
|
-
- rvm: ruby-head
|
|
16
|
-
fast_finish: true
|
|
17
|
-
before_script:
|
|
18
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
19
|
-
- chmod +x ./cc-test-reporter
|
|
20
|
-
- if [ $(rvm current) = $CC_RUBY_VERSION ]; then ./cc-test-reporter before-build; fi
|
|
21
|
-
after_script:
|
|
22
|
-
- if [ $(rvm current) = $CC_RUBY_VERSION ]; then ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT; fi
|