openapi_parser 0.7.0 → 0.8.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: e6fdbfb2bf6d7101bc016fc611e144cba0c53ee1456f433f62200f6b216d15ef
4
- data.tar.gz: 27f093ed770beca6b908f9079306afc4f74d81de136c9da8e295ab3ccf833cc6
3
+ metadata.gz: f4bfefc368dc8568d119cd8d16e30b1d804fa4651d44d857c13f8374ce2d7a70
4
+ data.tar.gz: a2120a0b9207a8f8342b7ccc9bfba70d0a40a03e549beeb0d4b5af47df8f6437
5
5
  SHA512:
6
- metadata.gz: c179283bac82745556d85ee1c02dcf0a2135caa60ff16c6f6b1fa44ff83de531631cc4b39da00c12b0a9e3e11eb2e606d9dc2b53f7b53cee47aa4e4e7a12e709
7
- data.tar.gz: 1638236c9fd1b22b7922ce8e2f81c942748101ef71e919fa7333b8a7e854a43c5e9ba738e47a61ffd823f682997f33c15634b18f515a88d5ddb7670bda205965
6
+ metadata.gz: 675babc15acd34ad745577c46a806ccf9a24e05077359ab7c28ff037c6a7f5f7196021a597fd50a277c1c19f7277ea9f6ddf722d240113fd48329fd4780ab55c
7
+ data.tar.gz: 02faec5c8dd2f48dfd5be840c92fb0f0829ec3b15342c96b042ac8d75c2dd954f76acbe752687066afc7fe8fbacf0f2d0aaca452b9162e11ca1a8f1d15baddd3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.8.0 (2020-01-21)
4
+ * Append the example to the Pattern validator error message #64
5
+
3
6
  ## 0.7.0 (2020-01-15)
4
7
  * Avoid potential `.send(:exit)` #58
5
8
  * Improve PathItemFinder #44
@@ -155,14 +155,15 @@ module OpenAPIParser
155
155
  end
156
156
 
157
157
  class InvalidPattern < OpenAPIError
158
- def initialize(value, pattern, reference)
158
+ def initialize(value, pattern, reference, example)
159
159
  super(reference)
160
160
  @value = value
161
161
  @pattern = pattern
162
+ @example = example
162
163
  end
163
164
 
164
165
  def message
165
- "#{@reference} pattern #{@pattern} does not match value: #{@value}"
166
+ "#{@reference} pattern #{@pattern} does not match value: #{@value}#{@example ? ", example: #{@example}" : ""}"
166
167
  end
167
168
  end
168
169
 
@@ -55,7 +55,7 @@ class OpenAPIParser::SchemaValidator
55
55
  return [value, nil] unless schema.pattern
56
56
  return [value, nil] if value =~ /#{schema.pattern}/
57
57
 
58
- [nil, OpenAPIParser::InvalidPattern.new(value, schema.pattern, schema.object_reference)]
58
+ [nil, OpenAPIParser::InvalidPattern.new(value, schema.pattern, schema.object_reference, schema.example)]
59
59
  end
60
60
 
61
61
  def validate_max_min_length(value, schema)
@@ -1,3 +1,3 @@
1
1
  module OpenAPIParser
2
- VERSION = '0.7.0'.freeze
2
+ VERSION = '0.8.0'.freeze
3
3
  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.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ota42y
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-15 00:00:00.000000000 Z
11
+ date: 2020-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler