ParserConfig
struct ParserConfigConfiguration options for JSON parsing.
Example: var config = ParserConfig(max_depth=10, allow_comments=True) var data = loads(json_str, config).
Implements Movable
- Fields
max_depth: Int: Maximum nesting depth allowed. 0 = unlimited (default).allow_comments: Bool: Allow JavaScript-style comments (// and /* */). Default: False.allow_trailing_comma: Bool: Allow trailing commas in arrays and objects. Default: False.ijson: Bool: Enforce I-JSON (RFC 7493). Default: False.
__init__
def __init__(out self, max_depth: Int = Int(0), allow_comments: Bool = False, allow_trailing_comma: Bool = False, ijson: Bool = False) Create parser configuration.
- Args
max_depth: Maximum nesting depth (0 = unlimited).allow_comments: Allow // and /* */ comments.allow_trailing_comma: Allow trailing commas.ijson: Enforce the checkable rules of RFC 7493.
default
def default() -> Self Create default (strict) parser configuration.
lenient
def lenient() -> Self Create lenient parser configuration allowing common extensions.
interoperable
def interoperable() -> Self Create an I-JSON (RFC 7493) parser configuration.
Stricter than the default: the extensions stay off and the two checkable I-JSON rules are enforced.