Description
Count slash-separated tokens and mark terminalEmpty for a trailing slash.
JSON Pointer separates path tokens with slashes and escapes literal slash and tilde inside member names. The empty pointer denotes the document root; an empty token can name an actual empty-string member.
Count slash-separated tokens and mark terminalEmpty for a trailing slash.
When to use this tool
Use JSON Pointer Terminal Empty Segment when you need a pointer token, depth, or representation check.
How to use the tool and how it works
- Enter pointer. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read terminalEmpty, tokenCount. Inspect terminalEmpty before interpreting the associated values.
Require an empty pointer or slash-prefixed text with tilde escapes restricted to ~0 and ~1. Count slash-separated tokens and mark terminalEmpty for a trailing slash.1
The root pointer has no reference tokens. A slash-delimited empty reference token is a member-name token, so the root and a pointer ending in an empty token must be distinguished.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| pointer | Pointer text in the exact syntax accepted by this tool. | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| terminalEmpty | Terminal Empty | Required. Boolean. |
| tokenCount | Number of parsed pointer reference tokens; root has none. | Required. Safe integer. |
{
"input": {
"pointer": "/a/"
},
"output": {
"terminalEmpty": true,
"tokenCount": 2
}
} Limitations and assumptions
- The empty string is the root with zero tokens; a slash represents one empty member name, and no document is resolved.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
Alternative or Complementary methods
Use a complete pointer parser and resolve against the actual document when existence or array access matters.
References
-
Calculation and input contract: json/json-pointer-terminal-empty-segment — tool.io
-
JavaScript Object Notation (JSON) Pointer (RFC 6901) — RFC Editor / IETF
Similar or alternative tools
- JSON Pointer Root Distance
Count zero segments for root or the slash-separated token count otherwise.
- JSON: JSON Pointer Empty Token Label
Parse pointer through the shared pointer helper.