Visual RFC.
ALL RFCs / RFC 6901
Read the RFC ↗
RFC 6901 / JSON POINTER

Unwrap a JSON string first

04

A pointer stored as a JSON string must pass through JSON string decoding before pointer evaluation.

RFC 6901 · § 5EXAMPLE
3 / 3
Unwrap a JSON string firstA JSON-serialized pointer string escapes an internal quote. JSON decoding yields /a"b; pointer evaluation selects the member named a"b, whose example value is 7.Two syntax layers, in orderExample object member name contains a quoteSerialized JSON string"/a\"b"JSON decodingPointer value: /a"bpointer evaluationExact member name: a"bValue: 7The quote is in the name, not a string boundary
03
Evaluate the pointer layer.

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 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
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.

KEY POINT

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.
DETAILS

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 ↗

All chapters in RFC 6901

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗