rack-json_schema 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -38
- data/README.md +1 -1
- data/lib/rack/json_schema/request_validation.rb +1 -5
- data/lib/rack/json_schema/version.rb +1 -1
- data/spec/rack/spec_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff47484c2c4c5c2aa4b576f3ae2973ed9330308c
|
4
|
+
data.tar.gz: a9b9edd703d900683a5d05a8a78571351a99cf13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
5
|
+
- Skip response validation on 3xx response
|
3
6
|
|
4
7
|
## 1.1.6
|
5
|
-
|
8
|
+
- Add :strict option to ignore undefined link
|
6
9
|
|
7
10
|
## 1.1.5
|
8
|
-
|
11
|
+
- Check Content-Type on response validation
|
9
12
|
|
10
13
|
## 1.1.4
|
11
|
-
|
14
|
+
- Skip validation of non-json request
|
12
15
|
|
13
16
|
## 1.1.3
|
14
|
-
|
17
|
+
- Validate request parameters in URI query too
|
15
18
|
|
16
19
|
## 1.1.2
|
17
|
-
|
20
|
+
- Support an empty array response at response validation
|
18
21
|
|
19
22
|
## 1.1.1
|
20
|
-
|
23
|
+
- Skip response validation if response code is 4xx or 5xx
|
21
24
|
|
22
25
|
## 1.1.0
|
23
|
-
|
26
|
+
- GET /docs returns HTML
|
24
27
|
|
25
28
|
## 1.0.7
|
26
|
-
|
29
|
+
- Accepts GET /docs.md
|
27
30
|
|
28
31
|
## 1.0.6
|
29
|
-
|
32
|
+
- Improve list detection logic
|
30
33
|
|
31
34
|
## 1.0.5
|
32
|
-
|
35
|
+
- Declare charset=utf-8 in response content type
|
33
36
|
|
34
37
|
## 1.0.4
|
35
|
-
|
38
|
+
- Return example of array property
|
36
39
|
|
37
40
|
## 1.0.3
|
38
|
-
|
41
|
+
- Remove dependency on multi_json
|
39
42
|
|
40
43
|
## 1.0.2
|
41
|
-
|
44
|
+
- Bundled all middlewares into `specup` executable command
|
42
45
|
|
43
46
|
## 1.0.1
|
44
|
-
|
47
|
+
- Add Rack::JsonSchema::SchemaProvider
|
45
48
|
|
46
49
|
## 1.0.0
|
47
|
-
|
50
|
+
- Rename: rack-spec -> rack-json_schema
|
48
51
|
|
49
52
|
## 0.1.8
|
50
|
-
|
53
|
+
- Add Rack::JsonSchema::Docs
|
51
54
|
|
52
55
|
## 0.1.7
|
53
|
-
|
56
|
+
- Reveal `Rack::JsonSchema::Schema#links`
|
54
57
|
|
55
58
|
## 0.1.6
|
56
|
-
|
59
|
+
- Support YAML schema at `specup`
|
57
60
|
|
58
61
|
## 0.1.5
|
59
|
-
|
62
|
+
- Add `specup` executable
|
60
63
|
|
61
64
|
## 0.1.4
|
62
|
-
|
63
|
-
|
65
|
+
- Add Rack::JsonSchema::Mock
|
66
|
+
- Prettify response JSON
|
64
67
|
|
65
68
|
## 0.1.3
|
66
|
-
|
69
|
+
- Array response support of Rack::JsonSchema::ResponseValidation
|
67
70
|
|
68
71
|
## 0.1.2
|
69
|
-
|
70
|
-
|
72
|
+
- Change Content-Type validation policy
|
73
|
+
- Add Rack::JsonSchema::ResponseValidation
|
71
74
|
|
72
75
|
## 0.1.1
|
73
|
-
|
76
|
+
- Add ErrorHandler rack middleware for building error response
|
74
77
|
|
75
78
|
## 0.1.0
|
76
|
-
|
79
|
+
- Rebuilt entire code based on JSON schema
|
77
80
|
|
78
81
|
## 0.0.5
|
79
|
-
|
82
|
+
- Change RESTful resource API (#get, #post, #put, and #delete)
|
80
83
|
|
81
84
|
## 0.0.4
|
82
|
-
|
85
|
+
- Add Rack::JsonSchema::Restful, strongly conventional RESTful API Provider
|
83
86
|
|
84
87
|
## 0.0.3
|
85
|
-
|
86
|
-
|
88
|
+
- Add a new constraint: required
|
89
|
+
- More DRY way for validator definition
|
87
90
|
|
88
91
|
## 0.0.2
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
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
|
-
|
96
|
-
|
97
|
-
|
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
|
data/spec/rack/spec_spec.rb
CHANGED
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.
|
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:
|
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.
|
237
|
+
rubygems_version: 2.4.5
|
238
238
|
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: JSON Schema based Rack middlewares
|