Skip to content
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

[Serializer] add a context to allow invalid values in BackedEnumNormalizer #48821

Open
wants to merge 1 commit into
base: 6.3
Choose a base branch
from

Conversation

nikophil
Copy link
Contributor

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
License MIT
Doc PR todo if PR gets merged

sometimes it is needed to allow deserialization of an enum to end up in a null value, this PR allows this behavior by passing a context

@nikophil nikophil requested a review from dunglas as a code owner Dec 29, 2022
@carsonbot carsonbot added this to the 6.3 milestone Dec 29, 2022
@nikophil nikophil force-pushed the serializer/allow-invalid-enum-value branch 2 times, most recently from d8e613f to cc6dfd1 Compare Jan 4, 2023
@AlexMinaev19
Copy link

@nikophil Maybe it would be nice if you will create a BackedEnumNormalizerContextBuilder for the new context parameter.
@nikophil, @dunglas What do you think?

@nikophil nikophil force-pushed the serializer/allow-invalid-enum-value branch 5 times, most recently from 89b9d3c to 8130e24 Compare Jan 23, 2023
Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I just left some minor comments.

@nikophil nikophil force-pushed the serializer/allow-invalid-enum-value branch from 8130e24 to 36cd0a2 Compare Jan 24, 2023
@nikophil nikophil requested review from dunglas and mtarld and removed request for dunglas Jan 24, 2023
@nikophil nikophil removed the request for review from mtarld Jan 24, 2023
mtarld
mtarld approved these changes Jan 24, 2023
@nikophil nikophil force-pushed the serializer/allow-invalid-enum-value branch 2 times, most recently from 5302a07 to b431dcc Compare Jan 25, 2023
@nikophil nikophil force-pushed the serializer/allow-invalid-enum-value branch from b431dcc to 6bc64f5 Compare Jan 26, 2023
@nikophil nikophil force-pushed the serializer/allow-invalid-enum-value branch from 6bc64f5 to 5dab5c2 Compare Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants