io.pedestal.json.protocols

added in 0.8.2

JSONProcessor

protocol

A wrapper around an underlying JSON parsing and encoding library.

members

read-json

(read-json this reader options)

Reads JSON from the provided Reader.

The JSONProcesser must support the following options:

Option Type Description
:key-fn fn Converts string keys; defaults to keyword
:eof-error? boolean If true, then throw an exception if the reader is at EOF (default is false)
:eof-value any Value to return if reader is at EOF (defaults to :eof)
:value-fn any Passed the key and the value and returns an updated value

Generally, any additional options are passed through to the underlying JSONProcessor implementation, but care should be given because different implementations will support different options.

stream-json

(stream-json this object stream)

Writes the object, as JSON, to the given output stream.

Returns the output stream, still open.