Fields

whitespace: enum {
    minified,
    indent_1,
    indent_2,
    indent_3,
    indent_4,
    indent_8,
    indent_tab,
    _,
} = .minified,

Controls the whitespace emitted. The default .minified is a compact encoding with no whitespace between tokens. Any setting other than .minified will use newlines, indentation, and a space after each ‘:’. .indent_1 means 1 space for each indentation level, .indent_2 means 2 spaces, etc. .indent_tab uses a tab for each indentation level.

emit_null_optional_fields: bool = true,

Should optional fields with null value be written?

emit_strings_as_arrays: bool = false,

Arrays/slices of u8 are typically encoded as JSON strings. This option emits them as arrays of numbers instead. Does not affect calls to objectField().

escape_unicode: bool = false,

Should unicode characters be escaped in strings?