Repository navigation
fix: decode JSON Pointer escape sequences - #57
Open
HocVoNgThai wants to merge 1 commit into
Open
HocVoNgThai wants to merge 1 commit into
HocVoNgThai wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Decode
~1to/and then~0to~before looking up each JSON Pointer token. This fixes both direct schema lookup and dereferencing without decoding escaped sequences twice.For example,
#/definitions/order~1countshould select the definition namedorder/count. It currently returnsnull, or selects the wrong schema if a literalorder~1countkey also exists. With this change, it selectsorder/countcorrectly; a consuming serializer returns{"count":42}instead of{"count":"42"}in the collision case.Adds regression coverage for slash, tilde, repeated escapes and the
~01decoding order throughgetSchema()andgetDerefSchema().