Welcome! Please see the About page for a little more info on how this works.

0 votes
in data.json by

The parser treats separator punctuation (commas between array and object members, colons between object keys and values) as whitespace similar to EDN does. This is not in accordance with any of the JSON specs, in particular the one that the library intends to follow (i.e. http://json.org/).

Some examples:

user> (json/read-str "{,,,\"w\"\"x\"\"y\"\"z\",,,}") {"w" "x", "y" "z"} user> (json/read-str "{\"x\"::::\"y\"}") {"x" "y"} user> (json/read-str "[1 2 3 4 5]") [1 2 3 4 5] user> (json/read-str "[1,,,5]") [1 5]

2 Answers

0 votes
by

Comment made by: dergutemoritz

OK, at least according to the two JSON RFCs, this behavior is permissible by a conforming implementation. See https://tools.ietf.org/html/rfc4627#section-4 and https://tools.ietf.org/html/rfc7159#section-9. Perhaps this behavior should at least be documented?

0 votes
by
Reference: https://clojure.atlassian.net/browse/DJSON-27 (reported by alex+import)
...