This JSON pointer resolver takes one JSON text and one RFC 6901 pointer and prints the value at that pointer. An empty pointer selects the whole document. Every other pointer starts with a slash. Tokens are separated by slashes. ~1 is a slash and ~0 is a tilde, and ~1 is applied before ~0. An empty token is a real property name, so a pointer that is only a slash selects the empty-string key, and a pointer written as slash slash a means the empty-string key and then a.
The value is shown as JSON text from JSON.stringify. A string therefore appears with quotes. The type line says object, array, string, number, boolean, or null. Copy writes that JSON text and does not write the type label. JSON null is a successful result. A missing member is an error. The page does not print null in place of a missing member, and an error clears the previous result.
On an array, the token 0, or a decimal without a leading zero, selects that index when the index exists. The token 01 is an error on an array. On an object, 01 is an ordinary key. The token – is an error on an array. It does not mean the last element. JSON Patch uses – for an add past the end, and this page does not apply a patch.
The walk uses own properties only. A prototype property is never a hit, and the pointer is not assigned onto any object. Duplicate keys follow JSON.parse, so the last key wins. A number is a JavaScript number after parsing. The page does not promise that an integer above 2^53-1 is the exact decimal written in the source text. A pointer that does not start with a slash is an error, including a JSON Path, a dot path, and the users[].name spelling used by the key extractor.
If the JSON text of the value is longer than 100,000 characters, the page shows the type and, for an object, the key count, or for an array, the length. It says the value is too large to display. It does not cut the JSON off in the middle. Copy still has the full JSON text of the value.
Nothing is sent off the page. The JSON is not stored. The result is text, so a string that looks like a script tag stays quoted JSON.
The document {“users”:[{“name”:”Ada”}]} and the pointer /users/0/name produces type string and the value “Ada”. The same document and /users/0 produces the object {“name”:”Ada”}. The document {“a/b”:1} and the pointer /a~1b produces 1. The document {“m~n”:2} and the pointer /m~0n produces 2. The document 5 and an empty pointer produces type number and the value 5. The document null and an empty pointer produces type null and the value null.
The pointer /b on {“a”:1} is a missing member, not null. The pointer /- on an array is an error. The pointer /01 on an array is an error, and the pointer /01 on the object {“01”:2} produces 2. A pointer written as a, or as $.a, or as users[].name, is an error because it does not start with a slash. A ~ that is not ~0 or ~1 is an error. {“a”:1,”a”:2} and /a produces 2, because JSON.parse keeps the last key.
The resolution stays in the browser. A result is the value named by the pointer you typed. It is not a schema check, not a patch, and not a list of every key in the document.
One RFC 6901 JSON pointer. An empty pointer selects the whole document. Every other pointer starts with /. ~1 is a slash and ~0 is a tilde, with ~1 applied first. An empty token is a real name, so / is the empty-string key. JSON null is a result. A missing member is an error and is not shown as null. On an array, 0 and a decimal without a leading zero select an existing index. 01 is an error on an array and a key on an object. The token - is an error and is not the last element. This page does not apply JSON Patch and does not read JSON Path or a users[].name path. Duplicate keys follow JSON.parse, so the last one wins. A number is a JavaScript number, not an exact decimal above 2^53-1. The value is JSON text. Nothing is sent or stored.
JSON null is a real value. A pointer that does not name a member is an error, and the previous result is cleared, so a missing member is not printed as null.
No. The pointer is RFC 6901. It starts with a slash, or it is empty. A dollar path, a dot path, and a users[].name path are errors.
It is an error. This page does not treat - as the last element and it does not apply a JSON Patch.
A number becomes a JavaScript number when the JSON is parsed. An integer above 2^53-1 is not promised as the exact decimal from the source text.