DocShell.Json.Depth (DocShell v2.0.0)

Copy Markdown View Source

Bounds JSON container nesting before decoding allocates a native tree.

The scanner searches original syntax bytes while skipping quoted strings and escapes. It allocates no decoded values and makes no network or filesystem call. A passing result is only a depth check: malformed JSON, duplicate keys and value types remain the decoder's responsibility.

Summary

Functions

Checks a binary against an explicit positive container-depth ceiling.

Functions

check(json, maximum)

@spec check(binary(), pos_integer()) :: :ok | {:error, term()}

Checks a binary against an explicit positive container-depth ceiling.