oas_parser 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/oas_parser/definition.rb +7 -6
- data/lib/oas_parser/endpoint.rb +2 -1
- data/lib/oas_parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af21e3945bcd537a9606bff192aed9cf48d8b0b18ff878f268bc416af4a3480d
|
4
|
+
data.tar.gz: 0a200ba60fbd11885a4bd6bc50daa6a970222da2eaac9253f5f1225e37beec27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e135ca6bf6a65fddf2c5bef4d0f802350fec90385af5d39b4e551b316a26f03362cad6c3a2fdcd9d0f63121f1367550b129cc385c1115f3c0b0dc45fcf149f36
|
7
|
+
data.tar.gz: 8c5b6cd7ba282839ff8e62125cee6ad16371c80849c29e3dbd6e781e123e1d1f057aef81293f00086acbbaafb0499d592835960f42175e92706760d2b1d5f2e7
|
data/Gemfile.lock
CHANGED
@@ -29,14 +29,15 @@ module OasParser
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def path_by_path(path)
|
32
|
-
definition = raw['paths']
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
definition = raw['paths'][path]
|
33
|
+
return OasParser::Path.new(self, path, definition) if definition
|
34
|
+
|
35
|
+
key = raw['paths'].keys.detect do |path_entry|
|
36
|
+
Mustermann::Template.new(path_entry).match(path)
|
37
37
|
end
|
38
|
+
definition = raw['paths'][key]
|
38
39
|
raise OasParser::PathNotFound.new("Path not found: '#{path}'") unless definition
|
39
|
-
OasParser::Path.new(self,
|
40
|
+
OasParser::Path.new(self, key, definition)
|
40
41
|
end
|
41
42
|
|
42
43
|
def security
|
data/lib/oas_parser/endpoint.rb
CHANGED
@@ -63,8 +63,9 @@ module OasParser
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
def response_by_code(code)
|
66
|
+
def response_by_code(code, use_default: false)
|
67
67
|
definition = raw['responses'][code]
|
68
|
+
definition ||= raw['responses']['default'] if use_default
|
68
69
|
raise OasParser::ResponseCodeNotFound.new("Response code not found: '#{code}'") unless definition
|
69
70
|
OasParser::Response.new(self, code, definition)
|
70
71
|
end
|
data/lib/oas_parser/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: oas_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Butler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|