jsown
jsown copied to clipboard
parse with keywords matches too liberally
When invoking parse
with the keywords to scan, it appears to return keys and values for partial matches, which does not appear to be the intent (at least not from my reading of doc)
With:
(defvar *j1* "{\"dude\": 42}")
we can happily query:
(jsown:parse *j1* "dude")
-> (:OBJ ("dude" . 42))
But we can also query a partial name:
(jsown:parse *j1* "dud")
-> (:OBJ ("dud" . 42))
Worse, with:
(defvar *j2* "{\"dude\": 42, \"duds\": 1001}")
we can construct a query that returns both elements:
(jsown:parse *j2* "dud")
-> (:OBJ ("dud" . 42) ("dud" . 1001))