diff --git a/lib/active_model_serializers/adapter/json_api/deserialization.rb b/lib/active_model_serializers/adapter/json_api/deserialization.rb index 1af20d94a..ce8fbbc5a 100644 --- a/lib/active_model_serializers/adapter/json_api/deserialization.rb +++ b/lib/active_model_serializers/adapter/json_api/deserialization.rb @@ -25,30 +25,30 @@ module Deserialization # # @example # document = { - # data: { - # id: 1, - # type: 'post', - # attributes: { - # title: 'Title 1', - # date: '2015-12-20' + # 'data' => { + # 'id' => 1, + # 'type' => 'post', + # 'attributes' => { + # 'title' => 'Title 1', + # 'date' => '2015-12-20' # }, - # associations: { - # author: { - # data: { - # type: 'user', - # id: 2 + # 'relationships' => { + # 'author' => { + # 'data' => { + # 'type' => 'user', + # 'id' => 2 # } # }, - # second_author: { - # data: nil + # 'second_author' => { + # 'data' => nil # }, - # comments: { - # data: [{ - # type: 'comment', - # id: 3 + # 'comments' => { + # 'data' => [{ + # 'type' => 'comment', + # 'id' => 3 # },{ - # type: 'comment', - # id: 4 + # 'type' => 'comment', + # 'id' => 4 # }] # } # } @@ -59,6 +59,7 @@ module Deserialization # # { # # title: 'Title 1', # # date: '2015-12-20', + # # id: 1, # # author_id: 2, # # second_author_id: nil # # comment_ids: [3, 4] @@ -70,8 +71,8 @@ module Deserialization # # { # # title: 'Title 1', # # published_at: '2015-12-20', - # # author_id: '2', - # # author_type: 'people' + # # author_id: 2, + # # author_type: 'User' # # } # def parse!(document, options = {})