diff --git a/lib/jsonapi/deserializable/resource.rb b/lib/jsonapi/deserializable/resource.rb index e911294..187a49b 100644 --- a/lib/jsonapi/deserializable/resource.rb +++ b/lib/jsonapi/deserializable/resource.rb @@ -189,7 +189,7 @@ module JSONAPI register_mappings(hash.keys, "/relationships/#{key}") - if options.[](:with_included) + if options.[](:with_included) && id.present? && type.present? return {**hash, key.to_sym => find_in_included(id:, type:)} end