diff --git a/lib/jsonapi/parser/resource.rb b/lib/jsonapi/parser/resource.rb index c0c3708..fd99003 100644 --- a/lib/jsonapi/parser/resource.rb +++ b/lib/jsonapi/parser/resource.rb @@ -11,7 +11,7 @@ def self.parse!(document) Document.ensure!(document.is_a?(Hash), 'A JSON object MUST be at the root of every JSONAPI ' \ 'request and response containing data.') - Document.ensure!(document.keys == ['data'].freeze && + Document.ensure!(document.keys.include?('data') && document['data'].is_a?(Hash), 'The request MUST include a single resource object ' \ 'as primary data.')