JSON serialization


The json vocabulary defines words for working with JSON (JavaScript Object Notation) formats.

Parsing strings in JSON format:
Image
json> ( string -- object )

Image
read-json ( -- object )

Image
read-jsons ( -- objects )

Image
path>json ( path -- json )

Image
path>jsons ( path -- jsons )


Converting objects to JSON format:
Image
>json ( obj -- string )

Image
write-json ( obj -- )


Working with JSON null values:
Image
json-null? ( object -- ? )

Image
if-json-null ( x if-null else -- )

Image
when-json-null ( x if-null -- )

Image
unless-json-null ( x else -- )


Working with JSON Lines format:
Image
jsonlines> ( string -- objects )

Image
read-jsonlines ( -- objects )

Image
>jsonlines ( objects -- string )

Image
write-jsonlines ( objects -- )


For more information, see https://en.wikipedia.org/wiki/JSON.