-
-
Notifications
You must be signed in to change notification settings - Fork 900
DISABLE_TYPE_ENFORCEMENT is ignored for non-scalar properties #5584
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
Labels
Comments
I made a workaround using composer to replace a snippet of code from the AbstractItemNormalizer class.
Same solution as suggested in a previous issue #4250 It's not ideal, but it fixes the problem temporarily. Soon I will make a pull request. |
soyuka
added a commit
to soyuka/core
that referenced
this issue
May 22, 2023
can you try my patch at #5593 ? |
soyuka
added a commit
to soyuka/core
that referenced
this issue
May 22, 2023
soyuka
added a commit
to soyuka/core
that referenced
this issue
May 22, 2023
soyuka
added a commit
that referenced
this issue
May 23, 2023
@soyuka thank you for the fix. |
soyuka
added a commit
to soyuka/core
that referenced
this issue
May 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to disable type enforcement so I don't get type errors on nullable=false properties.
Instead, I want to see error messages from Assert\NotBlank, Assert\NotNull, etc.
My request:
Actual answer:
Expected response:
As you can see from the actual answer
DISABLE_TYPE_ENFORCEMENT
does not work for any objects. I have tested it for relations and enum classes (Works for only scalar types).After researching the problem, I found that in properties with the Object type, we simply do not get to this condition.
core/src/Serializer/AbstractItemNormalizer.php
Lines 843 to 845 in 7a1d351
What do you think about this? Maybe this was expected behavior for you?
This issue has also been mentioned here: #1786
The text was updated successfully, but these errors were encountered: