jsown icon indicating copy to clipboard operation
jsown copied to clipboard

parse with keywords matches too liberally

Open garethw14 opened this issue 5 years ago • 0 comments

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))

garethw14 avatar Nov 08 '19 19:11 garethw14