-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
Expected behavior vs actual behavior
In the YARD docs the example suggests that using a symbol-keyed hash will work:
active_model_serializers/lib/active_model_serializers/adapter/json_api/deserialization.rb
Lines 27 to 56 in 873cf4a
| # document = { | |
| # data: { | |
| # id: 1, | |
| # type: 'post', | |
| # attributes: { | |
| # title: 'Title 1', | |
| # date: '2015-12-20' | |
| # }, | |
| # associations: { | |
| # author: { | |
| # data: { | |
| # type: 'user', | |
| # id: 2 | |
| # } | |
| # }, | |
| # second_author: { | |
| # data: nil | |
| # }, | |
| # comments: { | |
| # data: [{ | |
| # type: 'comment', | |
| # id: 3 | |
| # },{ | |
| # type: 'comment', | |
| # id: 4 | |
| # }] | |
| # } | |
| # } | |
| # } | |
| # } |
(Edited)
But in the code, it will actually check via string-keys:
https://github.com/rails-api/active_model_serializers/blob/v0.10.10/lib/active_model_serializers/adapter/json_api/deserialization.rb#L118
Metadata
Metadata
Assignees
Labels
No labels