Skip to content

Normalize invalid JsonPointer.set() assignments to JsonPointerException - #82

Closed
stefankoegl with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-jsonpointer-set-validation
Closed

stefankoegl with Copilot wants to merge 2 commits into
masterfrom
copilot/fix-jsonpointer-set-validation

Conversation

Copilot AI commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

JsonPointer.set() leaks native exceptions for out-of-range indices and unsupported assignment targets, bypassing callers’ pointer-error handling.

  • Error handling: Convert assignment/append IndexError, TypeError, and AttributeError to JsonPointerException, preserving valid writes and duck-typed containers.
  • Regression coverage: Cover invalid root and nested targets in both inplace modes, including immutable containers and list bounds.
JsonPointer("/5").set([1, 2], 42, inplace=False)
# JsonPointerException: index '5' is out of bounds

Co-authored-by: stefankoegl <184196+stefankoegl@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix JsonPointer.set() to validate assignment target Normalize invalid JsonPointer.set() assignments to JsonPointerException Oct 2, 2026
Copilot AI requested a review from stefankoegl October 2, 2026 10:57
@stefankoegl stefankoegl closed this Oct 2, 2026
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.

BUG: JsonPointer.set() does not validate assignment target (RFC 6901 non-compliant)

2 participants