You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I found a case which is very similar to #182 but for positive numbers with plus sign.
Serializing 14 currently results in "14".
Serializing -14 currently results in "-14".
But Serializing +14 currently results in +14, instead of "+14".
im not sure this is a good idea. numbers can get much more complicated than that pattern (octal, exponent, ...), so i'm not sure why a preceding + should be allowed but more complicated patterns should not be.
While I agree there may be complications wrt more complex numbers, I do think that addressing this particular issue still makes sense. So I'd be +1 for a patch -- if so, against 2.15 as its still behavioral change that could cause some (bogus test?) failures somewhere and it's better to keep those to minor versions.
cowtowncoder
changed the title
Positive numbers with plus sign not quoted correctly with ALWAYS_QUOTE_NUMBERS_AS_STRINGS
Positive numbers with plus sign not quoted correctly with ALWAYS_QUOTE_NUMBERS_AS_STRINGSFeb 10, 2023
Implemented as suggested; only adds support for leading +, no further changes for octals etc (not against those but solving one issue at a time, lowest hanging fruit)
Hello!
I found a case which is very similar to #182 but for positive numbers with plus sign.
Serializing
14
currently results in"14"
.Serializing
-14
currently results in"-14"
.But Serializing
+14
currently results in+14
, instead of"+14"
.It looks like update
PLAIN_NUMBER_P
regexp with(-|\\+)?[0-9]*(\\.[0-9]*)?
in https://github.com/FasterXML/jackson-dataformats-text/blob/2.15/yaml/src/main/java/com/fasterxml/jackson/dataformat/yaml/YAMLGenerator.java#L220 should solve this problem.https://regex101.com/r/eQo6ag/1
Do you have any objections about this fix?
I am ready to open PR =)
The text was updated successfully, but these errors were encountered: