Add JsonReadFeature.ALLOW_HEXADECIMAL_NUMBERS for JSON5-style hexadecimal integer literals (original) (raw)
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:
- hexadecimal numbers
- trailing decimal points on numbers (added via Add option to accept non-standard trailing decimal point (JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS) #773)
- plus signs before numbers (added via Add a feature to allow leading plus sign (JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS) #774)
- extra whitespace characters
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:
- Add option to accept non-standard trailing decimal point (JsonReadFeature.ALLOW_TRAILING_DECIMAL_POINT_FOR_NUMBERS) #773 adds
JsonReadFeature.ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERSto allow trailing decimal points on numbers - Add a feature to allow leading plus sign (JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERS) #774: adds
JsonReadFeature.ALLOW_LEADING_PLUS_SIGN_FOR_NUMBERSto allow leading plus sign on numbers