Mapping between JSON and CL datatypes
By default, YASON performs the following mappings between JSON and CL datatypes:
| JSON datatype |
CL datatype |
Notes |
|---|---|---|
| object | hash-table :test #'equal |
Keys are strings by default, see |
*parse-object-key-fn*
*parse-json-arrays-as-vectors*
*parse-json-booleans-as-symbols*
*parse-json-booleans-as-symbols*
Parsing JSON data
JSON data is always completely parsed into an equivalent in-memory representation. Upon reading, some translations are performed by default to make it easier for the Common Lisp program to work with the data; see mapping for details. If desired, the parser can be configured to preserve the full semantics of the JSON data read.
Encoding JSON data
YASON provides for two distinct modes to encode JSON data: Applications can either create an in memory representation of the data to be serialized, then have YASON convert it to JSON in one go, or they can use a set of macros to serialze the JSON data element-by-element, thereby having fine grained control over the layout of the generated data.ASDF-install package (obsolete) http://common-lisp.net/project/yason/files/yason.tar.gz