class

JsonReader

@Js
class JsonReader : Obj

Read Haystack data in JSON format.

constructors make

Wrap input stream

fields opts

methods readGrid

Convenience for readVal as Grid

readVal

Read a value and auto close stream

make new make(InStream in, Dict? opts)

Wrap input stream. By default, the reader decodes JSON in the Haystack 4 (Hayson) format. Use the v3 option to decode JSON in the Haystack 3 format.

The following opts are supported:

  • v3 (Marker): read JSON encoded in the Haystack 3 format
g := JsonReader(in).readGrid

val := JsonReader(in, Etc.makeDict(["v3":Marker.val])).readVal

opts Dict : opts

readGrid virtual Grid readGrid()

Convenience for readVal as Grid

readVal Obj? readVal(Bool close)

Read a value and auto close stream

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST