Support Unquoted Values
See original GitHub issueIn both Gson and org.json a unquoted value will be interpreted as a string. So given this array (note that apple is not quoted):
[33.5, 42, "foo", true, apple]
The resulting ArrayNode equivalent in those frameworks (JsonArray and JSONArray respectfully) will interpret it as
[33.5, 42, "foo", true, "apple"]
I have a OSS utility (Unirest-Java), that will allow users to bring their own favorite Json parsing engine. So I have an abstraction for them, and trying to make them operate with the same rules. This one I can’t deal with unless Jackson were to handle it. I noticed you have a JsonReadFeature for ALLOW_UNQUOTED_FIELD_NAMES, it would be super cool if there was a ALLOW_UNQUOTED_VALUES
Thanks for all the hard work. Jackson is a fantastic library and a real backbone of the world of Java you should be really proud of it!
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (8 by maintainers)
Top GitHub Comments
Yes, this would require a new option like
JsonReadFeature.ALLOW_UNQUOTED_VALUES
. I probably won’t have time to tackle this, but maybe someone else might find time. This feature would need to be implemented for all 4 backends (Reader, InputStream, DataInput, non-blocking); some of code used for unquoted field names might prove valuable.One thing to note is that the definition of where an unquoted value ends will probably require “interesting” heuristics – given that such values are not legal JSON (and shame on org.json / Gson accepting them by default…), there is no definition of how such values should be decoded; choice of end markers is rather large.
Yes. Once you leave the spec path, results might be surprising 😉