Open sshaw opened 7 years ago
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
Is your server expecting the page to be a parameter page["number"] rather than the default page["page"]? Ref: https://github.com/chingor13/json_api_client/blob/master/lib/json_api_client/paginating/paginator.rb#L7-L8
Sorry, cannot remember.
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
.