Json module

Json_Options

structSource

Fields

max_depth: := 256
nesting of arrays and objects
max_size: := 1 << 30
bytes of text
deny_unknown_fields: := false
Every struct denies unknown keys, as if it had @json(deny_unknown_fields). A struct's own note still denies when this is false.
missing_fields_default: := false
A missing field that is not optional keeps its declared initializer instead of failing with .MISSING_FIELD.
duplicate_keys: := Json_Duplicate_Keys.ERROR
What a repeated key in an object does. A Hash_Table already keeps the last value.
borrow: := false
Strings without escapes (and the keys and numbers of a Json_Value) are slices of the input text instead of copies; strings with escapes are still allocated from context.allocator. The input must outlive the result, and the result must never be released with free_json (nor may a failed decode free through a heap allocator): decode with context.allocator set to an arena or temp, whose free does nothing, and reset that instead. Ignored by the streaming from_json and by from_query/from_param, whose text does not outlive the call.

See also