Unwrap a JSON string first
04A pointer stored as a JSON string must pass through JSON string decoding before pointer evaluation.
Look up the exact name a followed by a quote and b, yielding 7 in the example object.
Source for this drawing: RFC 6901 · Read RFC section 5 ↗
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
- Reverse solidus
- The backslash character used by JSON string escapes.
- NUL
- The Unicode character U+0000; it can occur inside a pointer string.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
JSON string escaping and pointer escaping are separate layers.
- When a pointer is represented as a JSON string, quotation marks, reverse solidus (backslash) and control characters U+0000–U+001F MUST be escaped according to JSON string syntax.
- Unescape JSON backslash sequences before processing the resulting string as a JSON Pointer. Then apply pointer syntax and token decoding; do not treat JSON backslashes as pointer escape syntax.
- Pointers can contain the NUL character U+0000. Implementations in languages that use NUL as a string terminator need care to avoid truncation or misinterpretation.
In this example, the JSON text contains an escaped quote in the pointer string. Parsing produces /a"b, whose token names the object member a"b. Its value is 7. The quote is part of the member name; the JSON string boundary quotes are not.
Read the RFC section ↗