-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs for deserialization. #1431
Conversation
end | ||
|
||
def create_params | ||
ActiveModelSerializers::Deserialization.jsonapi_parse(params, only: [:title, :content, :author]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you include an example request that this would apply to? e.g.
POST /posts HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json
{
"data": {
// whatever
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, that would be great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@beauby , seeing the data before hand would help understand how much Deserialization is helping out :-)
once it's explained that both fields AND relationships can be passed in here, I think this'll be ready for merge :-)
Would be nice to show the available options as well, like |
What remains to be done on this? Is anyone interested in wrapping this up? |
I think it would be great to also see an example of how to deserialize relationship data as well. |
oh, it just figures out that one of the symbols is a relationship? that's pretty neat. :-) |
Examples in here https://github.com/rails-api/active_model_serializers/blob/master/lib/active_model_serializers/adapter/json_api/deserialization.rb |
on it! :-) |
Added the examples from the code :-) |
LGTM 👍 Thanks @NullVoxPopuli |
Add docs for deserialization.
Ref #1248