-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON pointers: "/" and "~" are not escaped #121
Comments
davishmcclurg
added a commit
that referenced
this issue
Dec 7, 2022
When building `data_pointer` and `schema_pointer` in error objects. JSON Pointer RFC[0]: > Because the characters '~' (%x7E) and '/' (%x2F) have special > meanings in JSON Pointer, '~' needs to be encoded as '~0' and '/' > needs to be encoded as '~1' when these characters appear in a > reference token. Fixes: #121 [0]: https://www.rfc-editor.org/rfc/rfc6901#section-3
davishmcclurg
added a commit
that referenced
this issue
Dec 7, 2022
When building `data_pointer` and `schema_pointer` in error objects. JSON Pointer [RFC][0]: ``` Because the characters '~' (%x7E) and '/' (%x2F) have special meanings in JSON Pointer, '~' needs to be encoded as '~0' and '/' needs to be encoded as '~1' when these characters appear in a reference token. ``` Fixes: #121 [0]: https://www.rfc-editor.org/rfc/rfc6901#section-3
davishmcclurg
added a commit
that referenced
this issue
Dec 7, 2022
When building `data_pointer` and `schema_pointer` in error objects. [JSON Pointer RFC][0]: ``` Because the characters '~' (%x7E) and '/' (%x2F) have special meanings in JSON Pointer, '~' needs to be encoded as '~0' and '/' needs to be encoded as '~1' when these characters appear in a reference token. ``` Fixes: #121 [0]: https://www.rfc-editor.org/rfc/rfc6901#section-3
Thanks for opening the issue @olofheurgren! Good catch. I opened a fix: #122 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
The RFC for JSON Pointer states that:
but it seems this is not done for the JSON pointers included in the return value of
validate
.For instance, this code:
returns:
but according to the RFC, the value of
"data_pointer"
should be:"/foo~1bar~0"
and the value of
"schema_pointer"
should be"/properties/foo~1bar~0"
The text was updated successfully, but these errors were encountered: