Escape JSON Patch Path for Key with Backslash
austince opened this issue · 2 comments
austince commented
How would one create the object { "valid/key": true } with JSON Patch? I can't find anything in the RFC.
raymccrae commented
JSON Patch uses JSON Pointers to specify the path to elements of the JSON document. The answer you're looking for is documented in RFC6901, section 3. "~"(tilde) is encoded as "~0" and "/"(forward slash) is encoded as "~1".
[{"op": "add", "path": "/valid~1key", "value": true}]
austince commented
Ah great, thank you for pointing me there!