Skip to content

fix(python): add depth limit to py_to_json/json_to_py#469

Merged
chaliy merged 3 commits intomainfrom
claude/fix-427-Y2nIj
Mar 2, 2026
Merged

fix(python): add depth limit to py_to_json/json_to_py#469
chaliy merged 3 commits intomainfrom
claude/fix-427-Y2nIj

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Mar 2, 2026

Summary

  • py_to_json and json_to_py recursively traverse nested structures without depth limit
  • Added MAX_NESTING_DEPTH = 64; exceeding it raises ValueError

Test plan

  • Python test: test_deeply_nested_schema_rejected

Closes #427

claude added 3 commits March 2, 2026 01:56
Both functions now fail with a clear error beyond 64 nesting levels,
preventing stack overflow from deeply nested Python/JSON structures.

Closes #427
@chaliy chaliy merged commit 5665695 into main Mar 2, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[L-3] Unbounded recursion in py_to_json/json_to_py conversion

2 participants