apia 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/apia/definitions/error.rb +1 -1
- data/lib/apia/response.rb +7 -4
- data/lib/apia/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: 3ca83d2cf83582c065e6af3a0ee926956ef3be223c0855103ee3df4a1bb5cd06
|
4
|
+
data.tar.gz: b6c384351af2236c7755c64e4b6c138594967079d6cb67587420f7773d64666f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ec614a5e14c0b146f1deb03e9193b3aad0a9f3e093f8b4fef298bc4e258308396c7d7ace3a3518b71b299b69ca202518ccd4edc957ab0014628643d46fc2740
|
7
|
+
data.tar.gz: 994a2a935d9c78da37e88f983b4e2e2466f229fba9801615a07f87a52ea3196fe49405311a56e481810c812efee6f342e7d92d133c6a9c292843af6a674f34f9
|
data/lib/apia/response.rb
CHANGED
@@ -70,11 +70,14 @@ module Apia
|
|
70
70
|
#
|
71
71
|
# @return [Array]
|
72
72
|
def rack_triplet
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
# Errors will always be sent as a hash intended for JSON encoding,
|
74
|
+
# even if the endpoint specifies a plain text response, so only
|
75
|
+
# send a pain response if the type is plaintext _and_ the body is
|
76
|
+
# a string
|
77
|
+
if @type == PLAIN && body.is_a?(String)
|
77
78
|
Rack.plain_triplet(body, headers: headers, status: status)
|
79
|
+
else
|
80
|
+
Rack.json_triplet(body, headers: headers, status: status)
|
78
81
|
end
|
79
82
|
end
|
80
83
|
|
data/lib/apia/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.7.
|
4
|
+
version: 3.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-05-
|
11
|
+
date: 2024-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|