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

Negative numbers not quoted correctly wrt ALWAYS_QUOTE_NUMBERS_AS_STRINGS #182

Closed
dpbevin opened this issue Mar 17, 2020 · 5 comments · Fixed by #183
Closed

Negative numbers not quoted correctly wrt ALWAYS_QUOTE_NUMBERS_AS_STRINGS #182

dpbevin opened this issue Mar 17, 2020 · 5 comments · Fixed by #183
Milestone

Comments

@dpbevin
Copy link
Contributor

dpbevin commented Mar 17, 2020

When initializing a YamlFactory as follows, negative numbers are not quoted correctly.

YAMLFactory factory = new YAMLFactory();
factory.enable(YAMLGenerator.Feature.MINIMIZE_QUOTES);
factory.enable(YAMLGenerator.Feature.ALWAYS_QUOTE_NUMBERS_AS_STRINGS);

Serializing 60 currently results in "60".
Serializing -14 currently results in 14.

@cowtowncoder cowtowncoder added the need-test-case Further progress requires inclusion of problem reproduction, ideally test case label Mar 17, 2020
@cowtowncoder
Copy link
Member

I would need bit more information:

  1. Jackson version (2.10.3?)
  2. Code to reproduce: it may be straight-forward from description, but often there is some small setting that changes things -- so I usually ask for exact reproduction just to reduce round-trips to figure out what is different with test I try

and given that should be easy to figure out.

@cowtowncoder
Copy link
Member

Ah. Thanks!

@cowtowncoder cowtowncoder removed the need-test-case Further progress requires inclusion of problem reproduction, ideally test case label Mar 17, 2020
@cowtowncoder cowtowncoder changed the title Negative numbers not serialized correctly Negative numbers not quoted correctly wrt ALWAYS_QUOTE_NUMBERS_AS_STRINGS Mar 17, 2020
@cowtowncoder
Copy link
Member

@dpbevin Thank you very much for reporting this, contributing fix! Backported in 2.10 so it'll be in 2.10.4 as well as 2.11.0.

@cowtowncoder cowtowncoder added this to the 2.10.4 milestone Mar 17, 2020
@dpbevin
Copy link
Contributor Author

dpbevin commented Mar 17, 2020

I would need bit more information:

  1. Jackson version (2.10.3?)
  2. Code to reproduce: it may be straight-forward from description, but often there is some small setting that changes things -- so I usually ask for exact reproduction just to reduce round-trips to figure out what is different with test I try

and given that should be easy to figure out.

Sorry... I should have included this info in the report. I got carried away and went straight to the fix 😜

@cowtowncoder
Copy link
Member

cowtowncoder commented Mar 17, 2020

@dpbevin that's perfectly fine, I should have waited couple of minutes :)

(just happened to go through my email when notification just arrived)

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 a pull request may close this issue.

2 participants