JsonDoc¶
Top level JSON type containing an entire document. A JSON document consists of exactly 1 value.
Constructors¶
create¶
Default constructor building a document containing a single null.
Returns¶
- JsonDoc ref^
Public fields¶
var data: (F64 val | I64 val | Bool val |¶
[None](https://stdlib.ponylang.io/builtin-None/) val | [String](https://stdlib.ponylang.io/builtin-String/) val | [JsonArray](corral-json-JsonArray.md) ref |
[JsonObject](corral-json-JsonObject.md) ref)
The parsed JSON structure.
Will be a None
if parse(source: String)
has not been called yet.
Public Functions¶
string¶
Generate string representation of this document.
Parameters¶
Returns¶
- String val
parse¶
Parse the given string as a JSON file, building a document. Raise error on invalid JSON in given source.
Parameters¶
- source: String val
Returns¶
- None val ?
parse_report¶
Give details of the error that occurred last time we attempted to parse. If parse was successful returns (0, "").