openapi_parser 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03ecb03e959dd472600018d4b8e0978cb8e4b0a1eae5c71b27b7e48aa71a7820
|
4
|
+
data.tar.gz: cae628061130aa70c56fb845efc14fc1c57b9a14ea70a13976bc508ef573a94a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a16babec6dfe5adb06207bab3fb746f5ac42f228aef95b4339d43998ce092073ff5c1e8b00b950fbe626e667147a715ed33e1b7bb832f3fe40e136b8bfb2117
|
7
|
+
data.tar.gz: f52fadf6c9cf1f12614c3be3e886504cb3e4377f40151dceb6714e9384697727931643beaab8b19f96c62a06448ccf871d0069159460c45cf6b20e662f12902e
|
data/CHANGELOG.md
CHANGED
@@ -88,7 +88,7 @@ class OpenAPIParser::SchemaValidator
|
|
88
88
|
private
|
89
89
|
|
90
90
|
# @return [OpenAPIParser::SchemaValidator::Base, nil]
|
91
|
-
def validator(value, schema)
|
91
|
+
def validator(value, schema) # rubocop:disable Metrics/CyclomaticComplexity
|
92
92
|
return any_of_validator if schema.any_of
|
93
93
|
return all_of_validator if schema.all_of
|
94
94
|
return one_of_validator if schema.one_of
|
@@ -5,6 +5,8 @@
|
|
5
5
|
|
6
6
|
module OpenAPIParser::Schemas
|
7
7
|
class OpenAPI < Base
|
8
|
+
include OpenAPIParser::DefinitionValidatable
|
9
|
+
|
8
10
|
def initialize(raw_schema, config)
|
9
11
|
super('#', nil, self, raw_schema)
|
10
12
|
@find_object_cache = {}
|
@@ -28,5 +30,17 @@ module OpenAPIParser::Schemas
|
|
28
30
|
def request_operation(http_method, request_path)
|
29
31
|
OpenAPIParser::RequestOperation.create(http_method, request_path, @path_item_finder, @config)
|
30
32
|
end
|
33
|
+
|
34
|
+
# return the definition is valid or not
|
35
|
+
# @return Boolean
|
36
|
+
def valid_definition?
|
37
|
+
openapi_definition_errors.empty?
|
38
|
+
end
|
39
|
+
|
40
|
+
# return definition errors
|
41
|
+
# @return Array
|
42
|
+
def openapi_definition_errors
|
43
|
+
@openapi_definition_errors ||= validate_definitions([])
|
44
|
+
end
|
31
45
|
end
|
32
46
|
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: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ota42y
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- bin/setup
|
145
145
|
- lib/openapi_parser.rb
|
146
146
|
- lib/openapi_parser/concern.rb
|
147
|
+
- lib/openapi_parser/concerns/definition_validatable.rb
|
147
148
|
- lib/openapi_parser/concerns/expandable.rb
|
148
149
|
- lib/openapi_parser/concerns/findable.rb
|
149
150
|
- lib/openapi_parser/concerns/media_type_selectable.rb
|