Learn R Programming

bidux (version 0.4.0)

check_json_depth: Check JSON nesting depth recursively

Description

Validates that JSON data does not exceed a maximum nesting depth to prevent stack overflow and resource exhaustion attacks.

Usage

check_json_depth(obj, max_depth = 50, current_depth = 1)

Value

Logical TRUE if depth is acceptable, aborts with error if exceeded

Arguments

obj

JSON object (list or other R object from jsonlite::fromJSON)

max_depth

Maximum allowed nesting depth (default: 50)

current_depth

Current recursion depth (internal use)