-
-
Notifications
You must be signed in to change notification settings - Fork 900
denormalization does not ignore type enforcement for not nullable relationship fields. #4250
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
From #1957, API Platform's behavior is supposed to match Symfony's. What happens when using the Symfony Serializer directly? (i.e. something like |
I tested using this code, and it worked as expected, accepted null value for not nullable relationship fields.
|
I forgot in my "something like", obviously you should add Anyway it appears now that you're probably not giving enough information: your entity snippet is too incomplete (getter/setter? |
Sorry, my mistake, i'll exemplify better. When i send a single post request with the property "tipoIdioma" with null value, the api give me the following error: "Expected IRI or nested document for attribute "tipoIdioma", "NULL" given."
|
Someone ? Is that a bug? |
Just noticed your Anyway, there are many open issues, maybe you will get more attention if you provide a failing test (PHPUnit or Behat) and propose a fix (PR) (no guarantee but if you have some time...) |
Yes, my mistake, I already corrected the post. I had found a workaround using service decorator, but I lost the issue link :/ |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
API Platform version(s) affected: 2.6.4
Description
When i use the this config, the option "disable_type_enforcement" does not work for not nullable relationship fields.
Possible related issue: api-platform/api-platform#1786
How to reproduce
Send null value for the field in a post operation.
Possible Solution
Allow denormalization process ignore type enforcement even when field is not nullable, like this:
Additional Context
The text was updated successfully, but these errors were encountered: