-
-
Notifications
You must be signed in to change notification settings - Fork 151
Jackson can't handle underscores in numbers #146
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
Comments
Yes, this is correct place: thank you reporting the issue! |
Adding label |
@cowtowncoder can you assign this to me? |
@chennakesava Done! A good first step might be to do PR to add a failing test under
( After that, |
One more note: if possible, it'd be great to make the change against |
Hi, Thanks |
@conor-ward I don't know if @chennakesava is working on this, but as you can see there is no work linking to this issue yet so nothing committed so far. |
Thanks @cowtowncoder. I believe I have a fix for the issue in YamlParser on the |
@conor-ward No, doing a Pull Request is the usual way, but I will assign it to you just as marker for others. |
Fixed for 2.10.5, but looks like @asomov I wonder if you know whether YAML 1.2 handling makes this:
be tagged as String value; |
Looks like this might be change between YAML 1.1 and 1.2: if so, could remove some code from 3.0 as well. |
Thanks for the help @cowtowncoder, just wondering when |
YAML 1.2 is closer to JSON and _ is not a number. But there is a usecase where underscore can be accepted inside integers. |
@asomov I am not arguing for keeping it (although I can see both some pros and some cons), but mostly wondering about compatibility part, documentation. While Jackson could, if need be, add optional extra coercions, I think I would prefer sticking to default specification defined behavior. |
YAML 1.2 has added confusion. They introduced schemas. The JSON schema does not accept underscore, and the other schema does. SnakeYAML Engine now only supports JSON schema |
Ah. Interesting, did not know this was the main reason. |
After implementing #133, underscores are actually handled as expected with upcoming Jackson 2.12. NOTE: as per earlier comments, handling for standard decimal numbers has been working since 2.10.5. |
Not sure I've chosen the right repository to report the issue, but there's a similar one: #65
I can't see a "dataformats-text" explicit dependency so here's how I use it:
Below are tests proving it fails to parse numbers with underscores.
The text was updated successfully, but these errors were encountered: