problem_details 0.2.2 → 0.2.3
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 +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +4 -2
- data/VERSION +1 -1
- data/lib/problem_details/document.rb +3 -2
- data/lib/problem_details/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: 3dbc10dcfafafc3f0a5ab8e133bed56285533a9adcba459171f4d57c9d9b3136
|
|
4
|
+
data.tar.gz: a34e365906ec1b5d4d4d8946369a053c40debef9d871e84482369995ef011f9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bb93e0090a87c06f4021b5a70e3056c7c187629d93d6383aaa61153108dad7ae7dd426f2874af0434c3a3c8b4efc960fad76a32434737673afff9aa21e523d3b
|
|
7
|
+
data.tar.gz: 673be8931bf5b2ebabd6818b9e40f023bc8304c6d83dafd363721598df28aa83fca8d8b56e1061e3701ccf6fced41ae3de26d2b7af2da99c47851ed6933a889d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 0.2.3 / 2021-09-03
|
|
2
|
+
|
|
3
|
+
* Support the `#to_hash` implicit conversion protocol (#8) by @stevenharman
|
|
4
|
+
|
|
1
5
|
## 0.2.2 / 2019-10-30
|
|
2
6
|
|
|
3
7
|
* Remove default about:blank type (#5) by @akrawchyk
|
|
@@ -9,7 +13,7 @@
|
|
|
9
13
|
## 0.2.0 / 2018-03-20
|
|
10
14
|
|
|
11
15
|
### Enhancements:
|
|
12
|
-
* Introduce a new gem, `sinatra-problem_details`, the Sinatra problem detail
|
|
16
|
+
* Introduce a new gem, `sinatra-problem_details`, the Sinatra problem detail extension.
|
|
13
17
|
|
|
14
18
|
## 0.1.0 / 2018-03-26
|
|
15
19
|
|
data/README.md
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
# ProblemDetails
|
|
1
|
+
# ProblemDetails
|
|
2
|
+
|
|
3
|
+
[](https://github.com/nikushi/problem_details/actions/workflows/ci.yml)
|
|
4
|
+
[](https://badge.fury.io/rb/problem_details)
|
|
2
5
|
|
|
3
6
|
ProblemDetails is an implementation of [RFC7807 Problem Details for HTTP APIs](https://tools.ietf.org/html/rfc7807).
|
|
4
7
|
|
|
@@ -197,7 +200,6 @@ Content-Type: application/problem+json
|
|
|
197
200
|
"title": "Bad Request",
|
|
198
201
|
"status": 400,
|
|
199
202
|
"foo": "bar"
|
|
200
|
-
}
|
|
201
203
|
}
|
|
202
204
|
```
|
|
203
205
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.3
|
|
@@ -19,7 +19,7 @@ module ProblemDetails
|
|
|
19
19
|
@extentions = params
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
def
|
|
22
|
+
def to_hash
|
|
23
23
|
h = {}
|
|
24
24
|
%i[type title status detail instance].each do |key|
|
|
25
25
|
value = public_send(key)
|
|
@@ -27,9 +27,10 @@ module ProblemDetails
|
|
|
27
27
|
end
|
|
28
28
|
h.merge(@extentions)
|
|
29
29
|
end
|
|
30
|
+
alias_method :to_h, :to_hash
|
|
30
31
|
|
|
31
32
|
def to_json
|
|
32
|
-
|
|
33
|
+
to_hash.to_json
|
|
33
34
|
end
|
|
34
35
|
end
|
|
35
36
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: problem_details
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nobuhiro Nikushi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|