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
class Tech < JsonApiClient::Resource
self.site = "https://helpdesk/helpdesk/WebObjects/Helpdesk.woa/ra"
connection_options[:ssl] = { verify: false }
connection_options[:params] = { "apiKey" => 'Redacted' }
self.connection do |conn|
conn.use Faraday::Response::Logger
end
def self.table_name
"Techs"
end
end
$ rails c
Running via Spring preloader in process 31863
Loading development environment (Rails 4.2.5.1)
2.1.5 :001 > Tech.all
I, [2016-02-25T15:12:05.971271 #31863] INFO -- : get https://helpdesk/helpdesk/WebObjects/Helpdesk.woa/ra/Techs?apiKey=Redacted
D, [2016-02-25T15:12:05.971415 #31863] DEBUG -- request: User-Agent: "Faraday v0.9.2"
Content-Type: "application/vnd.api+json"
Accept: "application/vnd.api+json"
I, [2016-02-25T15:12:05.993385 #31863] INFO -- Status: 200
D, [2016-02-25T15:12:05.993495 #31863] DEBUG -- response: server: "Apache-Coyote/1.1"
x-webobjects-loadaverage: "47"
x-webobjects-servlet: "YES"
content-type: "application/json;charset=UTF-8"
content-length: "951"
date: "Fri, 26 Feb 2016 00:12:33 GMT"
connection: "close"
TypeError: no implicit conversion of String into Integer
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/parsers/parser.rb:59:in `fetch'
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/parsers/parser.rb:59:in `handle_json_api'
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/parsers/parser.rb:11:in `block in parse'
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/parsers/parser.rb:8:in `tap'
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/parsers/parser.rb:8:in `parse'
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/query/requestor.rb:63:in `request'
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/query/requestor.rb:26:in `get'
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/query/builder.rb:95:in `find'
from /usr/local/rvm/gems/ruby-2.1.5/gems/json_api_client-1.1.1/lib/json_api_client/query/builder.rb:83:in `to_a'
What am I doing wrong?
The text was updated successfully, but these errors were encountered:
I suppose the API that I'm hitting isn't conforming to the JSON API... the specs say that the response must be an object { } that contains a data key... Bummer, I was really hoping to use this gem...
It's a simple response,
with a simple model
What am I doing wrong?
The text was updated successfully, but these errors were encountered: