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
Calling result.pages.next results in the following error when the response is not JSON:
/Users/skyes/.rvm/gems/ruby-2.3.0/gems/json_api_client-1.5.1/lib/json_api_client/parsers/parser.rb:61:in `handle_json_api': undefined method `fetch' for #<String:0x007f98e1600028> (NoMethodError)
from /Users/skyes/.rvm/gems/ruby-2.3.0/gems/json_api_client-1.5.1/lib/json_api_client/parsers/parser.rb:11:in `block in parse'
from /Users/skyes/.rvm/gems/ruby-2.3.0/gems/json_api_client-1.5.1/lib/json_api_client/parsers/parser.rb:8:in `tap'
from /Users/skyes/.rvm/gems/ruby-2.3.0/gems/json_api_client-1.5.1/lib/json_api_client/parsers/parser.rb:8:in `parse'
from /Users/skyes/.rvm/gems/ruby-2.3.0/gems/json_api_client-1.5.1/lib/json_api_client/query/requestor.rb:60:in `request'
from /Users/skyes/.rvm/gems/ruby-2.3.0/gems/json_api_client-1.5.1/lib/json_api_client/query/requestor.rb:35:in `linked'
from /Users/skyes/.rvm/gems/ruby-2.3.0/gems/json_api_client-1.5.1/lib/json_api_client/linking/top_level_links.rb:35:in `fetch_link'
from /Users/skyes/.rvm/gems/ruby-2.3.0/gems/json_api_client-1.5.1/lib/json_api_client/paginating/paginator.rb:19:in `next'
from json-api-client-test.rb:17:in `<main>'
Yes, sad that servers don't respect content types but nevertheless I would expect a different error from this instead of it treating the String has a Hash.
The text was updated successfully, but these errors were encountered:
I'm seeing this same error and stacktrace (mostly) in version 1.5.2, though afaict I'm not calling next:
undefined method `fetch' for #<String:0x0000000b7cc828>
/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:59 in handle_json_api
/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:11 in block in parse
/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:8 in tap
/gems/json_api_client-1.5.2/lib/json_api_client/parsers/parser.rb:8 in parse
/gems/json_api_client-1.5.2/lib/json_api_client/query/requestor.rb:60 in request
/gems/json_api_client-1.5.2/lib/json_api_client/query/requestor.rb:27 in get
/gems/json_api_client-1.5.2/lib/json_api_client/query/builder.rb:100 in find
/gems/json_api_client-1.5.2/lib/json_api_client/query/builder.rb:88 in to_a
/gems/json_api_client-1.5.2/lib/json_api_client/query/builder.rb:104 in method_missing
Calling
result.pages.next
results in the following error when the response is not JSON:Yes, sad that servers don't respect content types but nevertheless I would expect a different error from this instead of it treating the
String
has aHash
.The text was updated successfully, but these errors were encountered: