Skip to content

v0.1.0

Choose a tag to compare

@takeokunn takeokunn released this 23 Jul 15:33
v0.1.0
53c7b91

First release of cl-json-kit — a dependency-free, SBCL-only JSON reader and writer for Common Lisp strings and character streams.

Highlights

  • Reading: parse (whole string), parse-prefix (one value + exclusive end position), and read-json (one value from a stream without over-consuming following input).
  • Parser options: shape (:object-type, :array-type, :key-type), duplicate-key policy, custom null/false/true values, and :key-decoder / :number-decoder / :object-hook / :array-hook callbacks.
  • Resource bounds for untrusted input: :max-depth, :max-input-length, :max-string-length, :max-number-length, :max-array-elements, :max-object-members, :timeout-seconds.
  • Distinct sentinels +json-null+ / +json-false+ (with json-null-p / json-false-p) keep JSON null and false distinguishable from Lisp nil and from each other.
  • UTF-16 surrogate pairs in \uXXXX escapes decode into a single character (e.g. emoji).
  • Rich errors: json-parse-error carries position, line, column, path, expected, context, and text; json-serialization-error carries message and path.
  • Writing: stringify (to string) and write-json (to stream) dispatch purely by Lisp type (hash-table → object, vector/list → array), never guessing an object/array shape from a cons list's structure. Options include :pretty, :indent, :sort-keys, :null-value / :false-value, :number-encoder, and output bounds.
  • Ordered objects: make-json-object / json-object-p / json-object-members preserve member order and duplicate keys, plus alist->json-object / json-object->alist.

Full details in CHANGELOG.md.