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

YAML: consider starting # and ending : as quotable characters #465

Merged
merged 2 commits into from Feb 29, 2024

Conversation

MikeEdgar
Copy link
Contributor

Scalar values starting with # or ending with : should be quoted. Currently, SnakeYAML will single-quote them automatically. This change will proactively trigger the double quote style used for other values that require quotes when MINIMIZE_QUOTES is enabled.

Signed-off-by: Michael Edgar <michael@xlate.io>
Copy link
Member

@cowtowncoder cowtowncoder left a comment

Choose a reason for hiding this comment

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

Looks good, will make some minor tweaks before merging but idea makes sense (change was subtle had to look carefully :) ).

@cowtowncoder
Copy link
Member

@MikeEdgar one procedural thing before merging: if we don't yet have CLA (only needs to be sent once for all contributions, before merging the first), it's here:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

and it's usually easiest to print, fill & sign, scan/photo, email to cla at fasterxml dot com.
Once we have it I'll go ahead and merge this.

Thank you very much for contributing this (esp. great to have test coverage); looking forward to merging it.

@cowtowncoder cowtowncoder merged commit a743df1 into FasterXML:2.17 Feb 29, 2024
4 checks passed
@MikeEdgar MikeEdgar deleted the include-boundary-quotecheck branch February 29, 2024 17:42
@oliversaggau
Copy link

oliversaggau commented May 16, 2024

I'm not quite sure if this is/was desired behavior, as the original description only states

Scalar values starting with # or ending with : should be quoted.

But upgrading springdoc in our project to version 1.8.0 (which uses jackson version 2.17 with this change) in our project resulted in all scalar values being double-quoted instead of single-quoted in the generated .yaml file, not only the ones starting with # or ending with : Nevermind me, it indeed only affected values starting with #. Just ignore my comment 🙈

@cowtowncoder
Copy link
Member

@oliversaggau Thank you for double-checking :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants