-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] Add ScalarNormalizer
to allow custom values for boolean
#58473
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
base: 6.4
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Hey! Thanks for your PR. You are targeting branch "6.4" but it seems your PR description refers to branch "7.2 for features / 5.4, 6.4, and 7.1 for bug fixes". Cheers! Carsonbot |
It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you. Cheers! Carsonbot |
"Allow edits from maintainer" doesn't work because that is a Group Repository |
ScalarNormalizer
to allow custom values for boolean
ScalarNormalizer
to allow custom values for booleanScalarNormalizer
to allow custom values for boolean
Your fix is very specific. Why ScalarNormalizer allows only booleans? You probably should create BooleanNormalizer instead. And it also mast supports denormalization, so you have to add appropriate methods and fix demormalization method in AbstractObjectNormalizer |
@andreybotanic because this is only the start, for #58429 I wanted to add something to format numeric/float/int too, Yeah, denormalization might need to be done too. My use-case was for normalizing into stuff that can be denormalized too. (like "true/false" for boolean.) I will try to update the denormalize way soon. (for example, "yes/no" for boolean) |
@nicolas-grekas similar to #59501 can you look into this MR? I need to find a way to normalize boolean into "true" and "false" instead of "1" and "0" |
i want to fix #58429 with this MR too, but that might need some thinking first
It still does work when the Normalizer is used with Serializer (like it normally would?),
but currently it crashes some Testcases I probably need to fix first. (that's why this is still a draft)
Even without the new ScalarNormalizer, it should still return return the expected result