flexirest 1.12.2 → 1.12.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 +6 -0
- data/lib/flexirest/request.rb +2 -2
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/request_spec.rb +12 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61eaaa77dfcbab57b714007844456fe903c759cbb981761a43b7eb4910da3463
|
4
|
+
data.tar.gz: 10e7bbe8cc3b35887eb34c32562af637ed8cd4aae34df0547c2e2cd52a730a7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 251b2a247480a4f7b3c46a70cd469c3ad24cbdb6c245703ec60658ae3429107a7a364eb12e8794c2e28729ebb58e7a17bc1d2fbeebf59a035d5f277032ba7d82
|
7
|
+
data.tar.gz: e4fb534d1775963465155761cd4e6b8a7f14e7c66b0f0406d48d39abe4810906c588a9f00fea1b9325b1ed6d1682c9224f47b07c0f75e51b48986d2be43f5e0c
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/request.rb
CHANGED
@@ -880,14 +880,14 @@ module Flexirest
|
|
880
880
|
|
881
881
|
if ignore_root
|
882
882
|
[ignore_root].flatten.each do |key|
|
883
|
-
body = body[key.to_s] if body.has_key?(key.to_s)
|
883
|
+
body = body[key.to_s] || {} if body.has_key?(key.to_s)
|
884
884
|
end
|
885
885
|
end
|
886
886
|
elsif is_xml_response?
|
887
887
|
body = @response.body.blank? ? {} : Crack::XML.parse(@response.body)
|
888
888
|
if ignore_root
|
889
889
|
[ignore_root].flatten.each do |key|
|
890
|
-
body = body[key.to_s] if body.has_key?(key.to_s)
|
890
|
+
body = body[key.to_s] || {} if body.has_key?(key.to_s)
|
891
891
|
end
|
892
892
|
elsif options[:ignore_xml_root]
|
893
893
|
Flexirest::Logger.warn("Using `ignore_xml_root` is deprecated, please switch to `ignore_root`")
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/request_spec.rb
CHANGED
@@ -221,6 +221,14 @@ describe Flexirest::Request do
|
|
221
221
|
}
|
222
222
|
end
|
223
223
|
|
224
|
+
class IgnoredRootWithNullValueExampleClient < ExampleClient
|
225
|
+
get :root, "/root", ignore_root: "feed", fake: %Q{
|
226
|
+
{
|
227
|
+
"feed": null
|
228
|
+
}
|
229
|
+
}
|
230
|
+
end
|
231
|
+
|
224
232
|
class IgnoredRootWithUnexpectedResponseExampleClient < ExampleClient
|
225
233
|
get :root, "/root", ignore_root: "feed", fake: %Q{
|
226
234
|
{
|
@@ -1587,6 +1595,10 @@ describe Flexirest::Request do
|
|
1587
1595
|
expect(IgnoredRootExampleClient.root.title).to eq("Example Feed")
|
1588
1596
|
end
|
1589
1597
|
|
1598
|
+
it "should not raise an error if ignore_root value is null" do
|
1599
|
+
expect(IgnoredRootWithNullValueExampleClient.root).to be_instance_of(IgnoredRootWithNullValueExampleClient)
|
1600
|
+
end
|
1601
|
+
|
1590
1602
|
it "should ignore an ignore_root parameter if the specified element is not in the response" do
|
1591
1603
|
expect(IgnoredRootWithUnexpectedResponseExampleClient.root.error.message).to eq("Example Error")
|
1592
1604
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flexirest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -407,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
407
407
|
- !ruby/object:Gem::Version
|
408
408
|
version: '0'
|
409
409
|
requirements: []
|
410
|
-
rubygems_version: 3.
|
410
|
+
rubygems_version: 3.5.6
|
411
411
|
signing_key:
|
412
412
|
specification_version: 4
|
413
413
|
summary: This gem is for accessing REST services in a flexible way. ActiveResource
|