Decode slash and tilde
02Decode ~1 as slash, then ~0 as tilde, after splitting the pointer into tokens.
The resulting member names are a/b and ~key. Do not split the recovered slash again.
Source for this drawing: RFC 6901 · Read RFC section 4 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
- Escape sequence
- A spelling that represents a reserved character inside a token.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
Separate the path first, then unescape each token in the specified order.
- A slash separates reference tokens. A slash within a member name is written ~1, and a tilde within a name is written ~0. A bare tilde or an escape such as ~2 is invalid pointer syntax.
- For each token, first replace ~1 with /, then replace ~0 with ~. The order matters: ~01 becomes the literal name ~1, not a slash.
- The example pointer /a~1b/~0key has two tokens. They decode to the names a/b and ~key. A decoded slash belongs to a name; it must not be split again as a path separator.
These are JSON Pointer escapes, not JSON backslash escapes or URI percent escapes. Pointers use characters rather than byte offsets. Exact member-name matching does not normalize visually similar Unicode spellings.
Read the RFC section ↗