Repository navigation
Raise documented exceptions for malformed patches and "from": "/-" - #224
Merged
Merged
Conversation
Some invalid input raised a bare TypeError instead of an exception callers catching JsonPatchException and JsonPointerException expect: - Patch elements that are not objects now raise InvalidJsonPatch. - A 'from' that is not a string or pointer raises InvalidJsonPatch, as a 'path' of that kind already did. 'copy' now also accepts a pointer object in 'from', like 'move' already did. - 'move' and 'copy' from the '-' of an array raise JsonPointerException, as 'remove' of it already did. test_malformed_patch_raises_documented_exceptions now passes, so its expectedFailure marker goes. test_raises_only_documented_exceptions keeps its marker until #213 and #214 are fixed, but loses its 'copy' from '/-' example. Fixes #215 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012GyRw6J1pYgw9XTeNaGPwX
…-0t4c7h # Conflicts: # jsonpatch.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some invalid input raised a bare TypeError instead of an exception
callers catching JsonPatchException and JsonPointerException expect:
as a 'path' of that kind already did. 'copy' now also accepts a
pointer object in 'from', like 'move' already did.
JsonPointerException, as 'remove' of it already did.
test_malformed_patch_raises_documented_exceptions now passes, so its
expectedFailure marker goes. test_raises_only_documented_exceptions
keeps its marker until #213 and #214 are fixed, but loses its
'copy' from '/-' example.
Fixes #215
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_012GyRw6J1pYgw9XTeNaGPwX