O'Reilly logo

Clojure Applied by Alex Miller, Ben Vandgrift

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JSON

JSON[28] has become one of the more common data formats for dealing with web applications and data exchange. It’s human-readable, and many resources are available for its use. These two factors make it an attractive option as a data format.

The fundamental concepts in JSON are the object and the array, as the two container types for any values in the data. Objects correspond strongly to Clojure’s hash-maps, being an set of key-value pairs. Arrays are ordered lists of arbitrary data and most closely resemble a vector in Clojure.

If we convert the users.edn file from earlier to users.json, it looks like this:

 
[
 
{"name": ​"Joe Smith"
 
"email"​: ​"joe@company.com"
 
"roles"​: [​"admin"​, ​"supervisor"​, ​"analyst"​]},
 
{"name": ​ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required