You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSON response from the server is failing to parse, because bamboozled is passing a HTTParty::Response object to JSON.parse. This will raise an exception: ArgumentError: strict_parse() expected a String or IO Object. That exception is caught, and bamboozled attempts to parse the JSON as XML, which also fails and raises an exception. That exception is not caught.
Expected behavior
The JSON from the server is parsed and returned.
How To Reproduce
irb(main):004:0> client = Bamboozled.client(subdomain: "<subdomain redacted>", api_key: "<api key redacted>")
irb(main):005:0> client.employee.all
MultiXml::ParseError: 1:1: FATAL: Start tag expected, '<' not found
from (irb):5
Environment
Ruby 2.4.5
Dependencies:
httparty (0.13.3)
json (1.8.6)
Potential solution
Change JSON.parse(response) to JSON.parse(response.body) in base.rb.
The text was updated successfully, but these errors were encountered:
@rhec thanks for the issue! Sorry it's taken a while to get back to you. The change you put in looks pretty good.
I'm having a hard to replicating the issue though. I'm guessing it has to do with the response that bamboo is giving you. Would you be able to paste in the response that you are getting back from bamboo?
Description
The JSON response from the server is failing to parse, because bamboozled is passing a
HTTParty::Response
object toJSON.parse
. This will raise an exception:ArgumentError: strict_parse() expected a String or IO Object.
That exception is caught, and bamboozled attempts to parse the JSON as XML, which also fails and raises an exception. That exception is not caught.Expected behavior
The JSON from the server is parsed and returned.
How To Reproduce
Environment
Ruby 2.4.5
Dependencies:
httparty (0.13.3)
json (1.8.6)
Potential solution
Change
JSON.parse(response)
toJSON.parse(response.body)
in base.rb.The text was updated successfully, but these errors were encountered: