-
-
Notifications
You must be signed in to change notification settings - Fork 893
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
standard_put: false Doesn't work for Embeddables #6914
Comments
PUT replaces everything I guess, isn't that working with PATCH though? |
PUT with standard_put: true replaces everything. PUT with standard_put: false is designed to replace only fields that are specified in payload. But this doesn't seem working correctly for nested objects/embeddables. PATCH requires json-patch payload, which is whole different league for our frontend to implement. This is why we do not use it. |
That's an "old" awkward behavior of the non-standard PUT as far as I remember; it's a PATCH-like that completely replaces the contents of the included top-level properties of the resource. |
For the record, our PATCH uses the JSON Merge Patch format, which is very similar to what you can do with the non-standard JSON Patch (which is indeed not very common, even if very practical) is currently not supported by API Platform (but that would be nice to have). |
API Platform version(s) affected: 4.0.14
Description
With standard_put: false, I expect that missing fields would not be reset to NULL. However, this is not true for Embeddables.
How to reproduce
If you send payload
And afterwards
client_secret
would be set toNULL
. Expectation is thatclient_secret
would preserve previous value (bar
).Possible Solution
Additional Context
I've not inspected if this is in general problem with any nested objects.
The text was updated successfully, but these errors were encountered: