check_json_depth: Check JSON nesting depth recursively

View source: R/telemetry_ingest.R

check_json_depthR Documentation

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)

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)

Value

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


bidux documentation built on Feb. 28, 2026, 1:06 a.m.