Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Serializer] AddScalarNormalizer 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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Hanmac wants to merge1 commit intosymfony:6.4
base:6.4
Choose a base branch
Loading
fromb3-it:scalarNormalizer

Conversation

Hanmac
Copy link
Contributor

@HanmacHanmac commentedOct 6, 2024
edited by OskarStark
Loading

QA
Branch?7.2
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix#58305 ,Fix#58056
LicenseMIT

i want tofix#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

@carsonbot

This comment was marked as outdated.

@HanmacHanmac marked this pull request as ready for reviewOctober 6, 2024 19:43
@carsonbotcarsonbot added this to the6.4 milestoneOct 6, 2024
@carsonbot
Copy link

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".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@carsonbot
Copy link

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

@Hanmac
Copy link
ContributorAuthor

"Allow edits from maintainer" doesn't work because that is a Group Repository

@OskarStarkOskarStark changed the titleAdd ScalarNormalizer to allow custom values for booleanAddScalarNormalizer to allow custom values for booleanOct 8, 2024
@carsonbotcarsonbot changed the titleAddScalarNormalizer to allow custom values for boolean[Serializer] AddScalarNormalizer to allow custom values for booleanOct 8, 2024
@andreybotanic
Copy link

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

@Hanmac
Copy link
ContributorAuthor

@andreybotanic because this is only the start, for#58429 I wanted to add something to format numeric/float/int too,
but I first need to think what the best way would be. Probably "sprintf" Format Strings?

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)

@Hanmac
Copy link
ContributorAuthor

@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"

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

4 participants
@Hanmac@carsonbot@andreybotanic@OskarStark

[8]ページ先頭

©2009-2025 Movatter.jp