-
-
Notifications
You must be signed in to change notification settings - Fork 900
POST (create new item) with nested data #1363
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
Comments
What format are you using (ie |
I try json --> {"id":1} . --> Update is not allowed for this operation. json --> {"@id":1} . --> try run SQL nested data INSERT command |
What works with POST /books
About |
api-platform/api-platform#249 not supported yet with plain IDs. |
@soyuka not supported when I POST data, but supported in PUT method?!
If I PUT data with nested content then it's successful. Video: https://youtu.be/kEuzdS4z3wk |
I was able to get something like this to work by adding "api_allow_update=true" in my deserialization context. Example AppBundle\Entity\Resource:
attributes:
normalization_context:
groups: [ 'resource.read' ]
denormalization_context:
api_allow_update: true
groups: [ 'resource.write' ] This allowed me to POST in data with full object references when I had embedded objects. It worked for me using JSON, LD+JSON, and HAL+JSON. |
This seems to be resolved. |
I would like POST with nested data, but don't succeed.
Sample:
Response:
Update is not allowed for this operation.
but when I update item (PUT) then process is good.
I don't want to use this code:
The text was updated successfully, but these errors were encountered: