<< Back to previous view

[DJSON-2] Add support for encoding maps and sequences Created: 07/Oct/11  Updated: 07/Mar/12  Resolved: 07/Mar/12

Status: Closed
Project: data.json
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Minor
Reporter: Tal Liron Assignee: Unassigned
Resolution: Declined Votes: 0
Labels: None


 Description   

Here is some trivial workaround code I've been using:

(defn jsonable [o]
	(cond
		(map? o)
			(zipmap
				(keys o)
				(map jsonable (vals o)))
		(seq? o)
			(map jsonable o)))


 Comments   
Comment by Stuart Sierra [ 14/Oct/11 8:38 AM ]

I don't understand. Maps and sequences have always been supported:

user=> (json-str {:a 1 :b 2})
"{\"a\":1,\"b\":2}"
user=> (json-str (range 5))
"[0,1,2,3,4]"
Generated at Mon Nov 24 18:51:20 CST 2014 using JIRA 4.4#649-r158309.