data.json

Add support for encoding maps and sequences

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • 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)))

Activity

Hide
Stuart Sierra added a comment -

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]"
Show
Stuart Sierra added a comment - 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]"

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: