Skip to content

Main content

JSON Pointer Terminal Empty Segment Tool

Compute json pointer terminal empty segment from explicit bounded inputs.

Loading tool…

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

  1. Enter pointer. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. 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 fieldMeaning and unitsAccepted input
pointerPointer text in the exact syntax accepted by this tool.Required. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
terminalEmptyTerminal EmptyRequired. Boolean.
tokenCountNumber of parsed pointer reference tokens; root has none.Required. Safe integer.
json
{
  "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

  1. Calculation and input contract: json/json-pointer-terminal-empty-segment — tool.io

  2. JavaScript Object Notation (JSON) Pointer (RFC 6901) — RFC Editor / IETF

Similar or alternative tools