Skip to content

[Serializer] [ObjectNormalizer] Filter int when using FILTER_BOOL #59501

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

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

DjordyKoert
Copy link
Contributor

@DjordyKoert DjordyKoert commented Jan 14, 2025

Q A
Branch? 7.1
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix ...
License MIT

Improves on #57541 to also allow numeric values 1 and 0 with FILTER_BOOL => true

Currently attempting to use the Serializer component to deserialize to deserialize a 1 or 0 result in the following error:

The type of the "booleanProperty" attribute for class "App\MyDTO" must be one of "bool" ("int" given).

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.2" but it seems your PR description refers to branch "7.1 / 7.2".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@nicolas-grekas nicolas-grekas modified the milestones: 7.2, 7.1 Jan 17, 2025
@nicolas-grekas
Copy link
Member

Thank you @DjordyKoert.

@nicolas-grekas nicolas-grekas merged commit 717ca76 into symfony:7.1 Jan 17, 2025
4 of 11 checks passed
This was referenced Jan 29, 2025
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.

3 participants