-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Yaml] Add flag to dump numeric key as string #48127
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
[Yaml] Add flag to dump numeric key as string #48127
Conversation
Hey! Thanks for your PR. You are targeting branch "6.2" but it seems your PR description refers to branch "6.3". Cheers! Carsonbot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. At first glance, the implementation looks a bit too simple, but I might be mistaken. My main concern is the very poor test coverage for this new feature. Introducing a new flag adds complexity and possible side effects. We should especially make sure that the flag plays nicely when being combined with other flags that affect array structures or type casting of any sort.
…rault) This PR was merged into the 6.2 branch. Discussion ---------- [Yaml] Extract duplicate code to private function | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> I saw the same code/logic was duplicated in `Inline` class while working on #48127. This little patch can avoid bug/inconsistency Commits ------- 6026422 [Yaml] Extract duplicate code to private function
377c613
to
27618ce
Compare
7da5d08
to
8be79bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Antoine, thanks for this contribution
Thank you @alamirault. |
47eafe9
to
35890e1
Compare
@alamirault Thank you for working on this! |
Sometime Yaml keys must be always string. (OpenApi spec for example)
This PR add support to dump int as string by using the
Yaml::DUMP_NUMERIC_KEY_AS_STRING
flag.Without flag (default)
With flag
(Unrelated fabbot failure)