Skip to content
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

~ and / show be replaced in patch path #45

Open
moonheart opened this issue Sep 22, 2020 · 1 comment
Open

~ and / show be replaced in patch path #45

moonheart opened this issue Sep 22, 2020 · 1 comment

Comments

@moonheart
Copy link

As rfc6901#section-3 documented, we should replace ~ with ~0 and replace / with ~1.

This is Also the problem I encounted when trying to patch k8s resources, error message: the server rejected our request due to an error in our request.

Json Patch

A JSON Pointer is a Unicode string (see [RFC4627], Section 3)
containing a sequence of zero or more reference tokens, each prefixed
by a '/' (%x2F) character.

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.

@shochwald-maptek
Copy link

Agreed, this is causing a bug in my use case where users legitimately enter values including a '/'.

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

No branches or pull requests

2 participants