Json module

Json_Error

structextensionSource

Why decoding failed and where. path names the value inside the document (tags[2], address.zip); line and column count from 1, the column in characters. message and path are allocated with context.allocator: free_json releases them.

Example↗
_, error := from_json([] s64, "[1, 2");
assert(error.kind == .SYNTAX && error.line == 1);
free_json(*error);

Fields

message: string
offset: int
byte offset in the text
line: int
column: int
path: string

See also