JSON Pointer (RFC 6901): Addressing Nested Values by Path
JSON Pointer (RFC 6901): address nested JSON values by path. Syntax, escaping rules, and how JSON Pointer is used in JSON Patch and JSON Schema.
Published:
Tags: json, developer-tools, advanced
JSON Pointer (RFC 6901): Addressing Nested Values by Path Every standard that needs to reference a specific location inside a JSON document — JSON Patch, JSON Schema fragments, OpenAPI discriminators, HTTP APIs that accept — uses JSON Pointer. It's the XPath of the JSON world, but far simpler: a single string that unambiguously identifies one value anywhere in a document. Syntax A JSON Pointer is a Unicode string starting with , followed by zero or more reference tokens separated by . Each token is either an object key or an array index (a non-negative integer with no leading zeros, except itself). The root pointer (empty string) is valid and refers to the whole document. This is commonly used in JSON Patch to replace the entire root. Escaping: ~0 and ~1 Because is the path separator, any…
All articles · theproductguy.in