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

JsonReadFeature: Introduce missing features for JSON5 compatibility #707

Open
GrahamLea opened this issue Jul 9, 2021 · 4 comments
Open
Labels
pr-needed Feature request for which PR likely needed (no active development but idea is workable)

Comments

@GrahamLea
Copy link

GrahamLea commented Jul 9, 2021

The optional features in the JSON parser allow it be configured to almost be a fully-compatible parser for JSON5.

There's just a few missing features, documented here:
https://stackoverflow.com/questions/68312227/can-the-jackson-parser-be-used-to-parse-json5

Summarised as:

I propose that additional Jackson features be added for each of these JSON5 features to allow Jackson to be used as a fully-compliant JSON5 parser.

(#612 was a similar but more specific request, though it seems that feature is already covered)

EDIT: Following work has been done:

@cowtowncoder
Copy link
Member

Sounds reasonable, as long as these are opt-in features (or, possibly, one JSON5 feature), to be added in JsonReadFeature and not defaults.
I probably won't have time to work on this in near future but as usual would be happy to help someone else has time for a PR or two!

@cowtowncoder
Copy link
Member

So, thanks to @pjfanning 's work, 2 number related features needed here are implemented to go in 2.14!

@cowtowncoder
Copy link
Member

Ok, so looks like we have 2 things missing:

  • Hexadecimal numbers
  • Extra whitespace

Of these, hex numbers might be relatively easy to add (esp. for blocking parsers).
White space could be trickier to do efficiently but maybe not (esp. for "common" white space like tabs and other low-numeric code ones); also seems like less commonly needed feature.

@cowtowncoder
Copy link
Member

cowtowncoder commented May 30, 2023

If anyone is interested, filing a separate issue for, say, Hexadecimal number support; adding unit tests (failing, under .../failing/) would be a way to get things started.
And probably new JsonReadFeature to enable said support (but not yet implemented)
If this is something that you are interested in getting implemented.

@cowtowncoder cowtowncoder removed the 2.14 label Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-needed Feature request for which PR likely needed (no active development but idea is workable)
Projects
None yet
Development

No branches or pull requests

2 participants