rack-json_schema 1.1.7 → 1.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76058664ded518126a7217cd15be28a7819f7da4
4
- data.tar.gz: 47486bee72899be258e35f91fcea32f242c7e690
3
+ metadata.gz: ff47484c2c4c5c2aa4b576f3ae2973ed9330308c
4
+ data.tar.gz: a9b9edd703d900683a5d05a8a78571351a99cf13
5
5
  SHA512:
6
- metadata.gz: d984a9d64ba309d9022f58d29461b5c51934edbe45b86f086120143140daa490d33de4e233f53f99ea89de7be47e418bd2ad668ce867430acebbd94518a20e7d
7
- data.tar.gz: 54f749aad28fd61b48fef1f642773e102fec1918a716ca906b69f2c39aa7970dbb43f33554a0de333e01f5fc8e01e886e23c12c2c332a02366a8f6116a663a9d
6
+ metadata.gz: f0dfd8e634d117c97c808a4084de7b63ebbd1e69c8cbe85566e736023d4695ddb7156ec3923e559ce0dc48803dfbb298556a0242feb064652dc258c1ecf56a05
7
+ data.tar.gz: 721c53040d685f5a07d96370b891e4e5917ec3fcbc21c41802a57fddd2d3cad61e6adbb4e76fc6fb50c298fc60a060ed56a4ebb93fad7a679a4644ff0fcada49
data/CHANGELOG.md CHANGED
@@ -1,97 +1,100 @@
1
+ ## 1.1.8
2
+ - Improve error message on LinkNotFound (thx @take)
3
+
1
4
  ## 1.1.7
2
- * Skip response validation on 3xx response
5
+ - Skip response validation on 3xx response
3
6
 
4
7
  ## 1.1.6
5
- * Add :strict option to ignore undefined link
8
+ - Add :strict option to ignore undefined link
6
9
 
7
10
  ## 1.1.5
8
- * Check Content-Type on response validation
11
+ - Check Content-Type on response validation
9
12
 
10
13
  ## 1.1.4
11
- * Skip validation of non-json request
14
+ - Skip validation of non-json request
12
15
 
13
16
  ## 1.1.3
14
- * Validate request parameters in URI query too
17
+ - Validate request parameters in URI query too
15
18
 
16
19
  ## 1.1.2
17
- * Support an empty array response at response validation
20
+ - Support an empty array response at response validation
18
21
 
19
22
  ## 1.1.1
20
- * Skip response validation if response code is 4xx or 5xx
23
+ - Skip response validation if response code is 4xx or 5xx
21
24
 
22
25
  ## 1.1.0
23
- * GET /docs returns HTML
26
+ - GET /docs returns HTML
24
27
 
25
28
  ## 1.0.7
26
- * Accepts GET /docs.md
29
+ - Accepts GET /docs.md
27
30
 
28
31
  ## 1.0.6
29
- * Improve list detection logic
32
+ - Improve list detection logic
30
33
 
31
34
  ## 1.0.5
32
- * Declare charset=utf-8 in response content type
35
+ - Declare charset=utf-8 in response content type
33
36
 
34
37
  ## 1.0.4
35
- * Return example of array property
38
+ - Return example of array property
36
39
 
37
40
  ## 1.0.3
38
- * Remove dependency on multi_json
41
+ - Remove dependency on multi_json
39
42
 
40
43
  ## 1.0.2
41
- * Bundled all middlewares into `specup` executable command
44
+ - Bundled all middlewares into `specup` executable command
42
45
 
43
46
  ## 1.0.1
44
- * Add Rack::JsonSchema::SchemaProvider
47
+ - Add Rack::JsonSchema::SchemaProvider
45
48
 
46
49
  ## 1.0.0
47
- * Rename: rack-spec -> rack-json_schema
50
+ - Rename: rack-spec -> rack-json_schema
48
51
 
49
52
  ## 0.1.8
50
- * Add Rack::JsonSchema::Docs
53
+ - Add Rack::JsonSchema::Docs
51
54
 
52
55
  ## 0.1.7
53
- * Reveal `Rack::JsonSchema::Schema#links`
56
+ - Reveal `Rack::JsonSchema::Schema#links`
54
57
 
55
58
  ## 0.1.6
56
- * Support YAML schema at `specup`
59
+ - Support YAML schema at `specup`
57
60
 
58
61
  ## 0.1.5
59
- * Add `specup` executable
62
+ - Add `specup` executable
60
63
 
61
64
  ## 0.1.4
62
- * Add Rack::JsonSchema::Mock
63
- * Prettify response JSON
65
+ - Add Rack::JsonSchema::Mock
66
+ - Prettify response JSON
64
67
 
65
68
  ## 0.1.3
66
- * Array response support of Rack::JsonSchema::ResponseValidation
69
+ - Array response support of Rack::JsonSchema::ResponseValidation
67
70
 
68
71
  ## 0.1.2
69
- * Change Content-Type validation policy
70
- * Add Rack::JsonSchema::ResponseValidation
72
+ - Change Content-Type validation policy
73
+ - Add Rack::JsonSchema::ResponseValidation
71
74
 
72
75
  ## 0.1.1
73
- * Add ErrorHandler rack middleware for building error response
76
+ - Add ErrorHandler rack middleware for building error response
74
77
 
75
78
  ## 0.1.0
76
- * Rebuilt entire code based on JSON schema
79
+ - Rebuilt entire code based on JSON schema
77
80
 
78
81
  ## 0.0.5
79
- * Change RESTful resource API (#get, #post, #put, and #delete)
82
+ - Change RESTful resource API (#get, #post, #put, and #delete)
80
83
 
81
84
  ## 0.0.4
82
- * Add Rack::JsonSchema::Restful, strongly conventional RESTful API Provider
85
+ - Add Rack::JsonSchema::Restful, strongly conventional RESTful API Provider
83
86
 
84
87
  ## 0.0.3
85
- * Add a new constraint: required
86
- * More DRY way for validator definition
88
+ - Add a new constraint: required
89
+ - More DRY way for validator definition
87
90
 
88
91
  ## 0.0.2
89
- * Change key name: queryParameters -> parameters
90
- * Add a new constraint: only
91
- * Add a new constraint: minimumLength
92
- * Add a new constraint: maxinumLength
92
+ - Change key name: queryParameters -> parameters
93
+ - Add a new constraint: only
94
+ - Add a new constraint: minimumLength
95
+ - Add a new constraint: maxinumLength
93
96
 
94
97
  ## 0.0.1
95
- * Add a new constraint: type
96
- * Add a new constraint: minimum
97
- * Add a new constraint: maxinum
98
+ - Add a new constraint: type
99
+ - Add a new constraint: minimum
100
+ - Add a new constraint: maxinum
data/README.md CHANGED
@@ -23,7 +23,7 @@ use Rack::JsonSchema::Mock, schema: schema if ENV["RACK_ENV"] == "mock"
23
23
  ```
24
24
 
25
25
  ### Rack::JsonSchema::RequestValidation
26
- Validates request and raises errors below.
26
+ Validates request and raises errors below. The rack will automatically look into the corresponding [hypermedia](http://json-schema.org/latest/json-schema-hypermedia.html#anchor6) definitions.
27
27
 
28
28
  * Rack::JsonSchema::RequestValidation::InvalidContentType
29
29
  * Rack::JsonSchema::RequestValidation::InvalidJson
@@ -47,7 +47,7 @@ module Rack
47
47
  raise InvalidParameter, "Invalid request.\n#{schema_validation_error_message}"
48
48
  end
49
49
  elsif strict?
50
- raise LinkNotFound
50
+ raise LinkNotFound.new("Could not find the link definition for request path #{path}.")
51
51
  end
52
52
  end
53
53
 
@@ -150,10 +150,6 @@ module Rack
150
150
 
151
151
  # Error class for case when no link defined for given request
152
152
  class LinkNotFound < Error
153
- def initialize
154
- super("Not found")
155
- end
156
-
157
153
  def status
158
154
  404
159
155
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module JsonSchema
3
- VERSION = "1.1.7"
3
+ VERSION = "1.1.8"
4
4
  end
5
5
  end
@@ -102,7 +102,7 @@ describe Rack::JsonSchema do
102
102
  should == 404
103
103
  response.body.should be_json_as(
104
104
  id: "link_not_found",
105
- message: "Not found",
105
+ message: "Could not find the link definition for request path #{path}.",
106
106
  )
107
107
  end
108
108
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-json_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-23 00:00:00.000000000 Z
11
+ date: 2015-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: erubis
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
234
  version: '0'
235
235
  requirements: []
236
236
  rubyforge_project:
237
- rubygems_version: 2.2.2
237
+ rubygems_version: 2.4.5
238
238
  signing_key:
239
239
  specification_version: 4
240
240
  summary: JSON Schema based Rack middlewares