This issue is a (choose one):
Description
I've tracked the issue to lib/jsonapi/processor.rb:587.
resource_set[resource_klass] is holding the associated resources in an array key'd by a string {"1" => [...]} and attempting to access it via an int resource.id.
With the following resources just issue this get request (make sure to have include=).
GET /uuids/3bbaf722-4583-4fa6-ac36-9190d4b93f80?include=ids
class UuidResource < JSONAPI::Resource
key_type :uuid
has_many :ids
end
class IdResource < JSONAPI::Resource
has_one :uuid
end
Throws error:
Internal Server Error: undefined method `[]' for nil:NilClass /var/lib/gems/2.3.0/bundler/gems/jsonapi-resources-d185ebb76cd2/lib/jsonapi/processor.rb:587:in `block (2 levels) in populate_resource_set'
/var/lib/gems/2.3.0/bundler/gems/jsonapi-resources-d185ebb76cd2/lib/jsonapi/processor.rb:586:in `each'
/var/lib/gems/2.3.0/bundler/gems/jsonapi-resources-d185ebb76cd2/lib/jsonapi/processor.rb:586:in `block in populate_resource_set'
/var/lib/gems/2.3.0/bundler/gems/jsonapi-resources-d185ebb76cd2/lib/jsonapi/processor.rb:542:in `each_key'
This issue is a (choose one):
Description
I've tracked the issue to
lib/jsonapi/processor.rb:587.resource_set[resource_klass]is holding the associated resources in an array key'd by a string{"1" => [...]}and attempting to access it via an intresource.id.With the following resources just issue this get request (make sure to have include=).
GET /uuids/3bbaf722-4583-4fa6-ac36-9190d4b93f80?include=ids
Throws error: