Skip to content
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

Handling nested params #106

Open
pollingj opened this issue May 16, 2016 · 3 comments
Open

Handling nested params #106

pollingj opened this issue May 16, 2016 · 3 comments

Comments

@pollingj
Copy link

pollingj commented May 16, 2016

Just started using the new to_attributes, finding it really useful. Any thoughts on how nested params could be handled with it, or would you see that being handled outside of this?

I'm just thinking in terms of this blog post - http://blog.plataformatec.com.br/2015/08/working-with-ecto-associations-and-embeds/

@alanpeabody
Copy link
Contributor

Honestly, I am not sure how this should be handled. The JSON-API spec had some extensions available for bulk create, as well as some discussion around this sort of thing. Personally the only place I have done this I ended up using some suggestions from a JSON-API issues I can no longer find.

I think until there is a specified format for this in the JSON-API spec it is premature to implement anything here. It may also be the case that if support comes as an extension there may need to be significant thought and work put into determining if and how extension support should be added to JaSerializer.

For the time being this would be a great place to discuss different strategies and how to implement them for Ecto.

@aizotov
Copy link

aizotov commented May 3, 2019

Any update on this?

@beerlington
Copy link
Contributor

@aizotov it sounds like there may be support for this in JSON:API v1.1. Once that is finalized then we'd be interested in doing something in JaSerializer.

Unfortunately I haven't found any way of doing it in the 1.0 spec that I really like or could recommend. Sometimes I can redesign the endpoint to not require nested data, but there's always those exceptions where you need to do something custom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants