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

YAMLGenerator does not quote tilde (~) characters when MINIMIZE_QUOTES is enabled #274

Closed
jameswynn opened this issue Jun 4, 2021 · 2 comments
Labels
yaml Issue related to YAML format backend
Milestone

Comments

@jameswynn
Copy link

As of 2.11.4 YAMLGenerator does not quote the tilde character when MINIMIZE_QUOTES is enabled. The YAML spec states that tilde represents null, and in fact Jackson interprets it as such, but it does not quote strings containing this by default. This should be included in the list of other special characters that get quoted as per #180.

@cowtowncoder cowtowncoder added 2.12 yaml Issue related to YAML format backend labels Jun 4, 2021
@cowtowncoder
Copy link
Member

cowtowncoder commented Jun 4, 2021

Thank you for reporting this: it sounds like a flaw.
I assume that check for tilde should only consider the first (non-space?) character; or possibly just full value being tilde. Leading white-space may be a challenge however so alternatively could simply check for existence in general I suppose.

PR for quoting would be highly welcome: I hope to get to this eventually (right now I am bit time-limited) but will try my best to help with PRs.

And even just submitting a PR for test that show the issue (write tilde-value as String, comes back as null) would be valuable. If so, would go against branch 2.12, under src/test/.../failing/ (to avoid failing build).

@cowtowncoder cowtowncoder added this to the 2.12.4 milestone Jun 25, 2021
@cowtowncoder
Copy link
Member

Fixed for 2.12(.4), with a simple test reproduction

Thank you for reporting this @jameswynn!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
yaml Issue related to YAML format backend
Projects
None yet
Development

No branches or pull requests

2 participants