oas_parser 0.16.0 → 0.17.0

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: 37e97626c43f146f01f818554db72c53c9aeb7d80adfdfeb030e64ed1c23bdff
4
- data.tar.gz: c5b84aabd9f633dedc50b9fcafc394f62585e7922bae8530f244582c375b5059
3
+ metadata.gz: 93b6c3c3723b36ea92dde86e6e3976f4ad0975b057e7ee9c1d7012cf345ad2a5
4
+ data.tar.gz: ab537a659bb0ed1ac55e3a4c8c661d3d1810b4a906f18a84750b50da87cccf93
5
5
  SHA512:
6
- metadata.gz: 16bcbfdf167076235e13b3d01a34796d7e0a67306dea7c10490ebe20a737e5e57f422a1853a680fb7346b93b402c7128c2b32461d99ad379c09e988a3e631ac8
7
- data.tar.gz: a6b26fcb02a9751e7019f10ad05bd20735dd0ba71aa631db63eb1376310c7fc05b1d8c925390317177cad797823ae7b6d05c0a6490022f1e4e36e0f68a41268b
6
+ metadata.gz: 4a6b6021fdf53af17e56d2b14a54e60dab00df1d6419ddb3ea45a1811d3ebe0b6e312f4ab4bce0e31492cec7900a43fa894f7efca26f21d4324fb40595f9bd35
7
+ data.tar.gz: 0acf4f364f02fbd1b53093a127f1186a0012cf6de3ed35ceae67d2aaf9bb0897dffe161545cd88432710dfc9d189c192ea3128269dddaa3db881fb1eea03acb9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- oas_parser (0.16.0)
4
+ oas_parser (0.17.0)
5
5
  activesupport (>= 4.0.0)
6
6
  addressable (~> 2.3)
7
7
  builder (~> 3.2.3)
@@ -112,4 +112,4 @@ DEPENDENCIES
112
112
  simplecov (~> 0.15.1)
113
113
 
114
114
  BUNDLED WITH
115
- 1.17.1
115
+ 1.17.2
@@ -35,7 +35,7 @@ module OasParser
35
35
  end
36
36
  raw['paths'][key]
37
37
  end
38
- raise StandardError.new('So such path exists') unless definition
38
+ raise OasParser::PathNotFound.new("Path not found: '#{path}'") unless definition
39
39
  OasParser::Path.new(self, path, definition)
40
40
  end
41
41
 
@@ -49,7 +49,7 @@ module OasParser
49
49
  return parameter if parameter.name == name
50
50
  end
51
51
 
52
- raise StandardError.new("No such parameter exists: '#{name}'")
52
+ raise OasParser::ParameterNotFound.new("Parameter not found: '#{name}'")
53
53
  end
54
54
 
55
55
  def request_body
@@ -65,7 +65,7 @@ module OasParser
65
65
 
66
66
  def response_by_code(code)
67
67
  definition = raw['responses'][code]
68
- raise StandardError.new('So such response exists') unless definition
68
+ raise OasParser::ResponseCodeNotFound.new("Response code not found: '#{code}'") unless definition
69
69
  OasParser::Response.new(self, code, definition)
70
70
  end
71
71
 
@@ -82,7 +82,7 @@ module OasParser
82
82
 
83
83
  def callback_by_name(name)
84
84
  definition = raw['callbacks'][name]
85
- raise StandardError.new('So such callback exists') unless definition
85
+ raise OasParser::CallbackNotFound.new("Callback not found: '#{name}'") unless definition
86
86
  OasParser::Callback.new(self, name, definition)
87
87
  end
88
88
 
@@ -0,0 +1,8 @@
1
+ module OasParser
2
+ class Error < StandardError; end
3
+ class CallbackNotFound < Error; end
4
+ class MethodNotFound < Error; end
5
+ class ParameterNotFound < Error; end
6
+ class PathNotFound < Error; end
7
+ class ResponseCodeNotFound < Error; end
8
+ end
@@ -19,7 +19,7 @@ module OasParser
19
19
 
20
20
  def endpoint_by_method(method)
21
21
  definition = raw[method]
22
- raise StandardError.new('So such endpoint exists') unless definition
22
+ raise OasParser::MethodNotFound.new("HTTP method not found: '#{method}'") unless definition
23
23
  OasParser::Endpoint.new(self, method, definition)
24
24
  end
25
25
 
@@ -1,3 +1,3 @@
1
1
  module OasParser
2
- VERSION = '0.16.0'.freeze
2
+ VERSION = '0.17.0'.freeze
3
3
  end
data/lib/oas_parser.rb CHANGED
@@ -16,8 +16,6 @@ Dir["#{File.dirname(__FILE__)}/oas_parser/**/*.rb"].each do |file|
16
16
  require file
17
17
  end
18
18
 
19
- File.expand_path('path', File.dirname(__FILE__))
20
-
21
19
  module OasParser
22
20
  # Your code goes here...
23
21
  end
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.16.0
4
+ version: 0.17.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-02-15 00:00:00.000000000 Z
11
+ date: 2019-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -216,6 +216,7 @@ files:
216
216
  - lib/oas_parser/callback.rb
217
217
  - lib/oas_parser/definition.rb
218
218
  - lib/oas_parser/endpoint.rb
219
+ - lib/oas_parser/errors.rb
219
220
  - lib/oas_parser/parameter.rb
220
221
  - lib/oas_parser/parser.rb
221
222
  - lib/oas_parser/path.rb