Skip to content

Main content

JSON: JSON Pointer Numeric Key Vs Index Tool

Interpret an already decoded JSON Pointer token only under an explicit object/array container context; hyphen is an append position only for a write operation.

Loading tool…

Description

For object containers classify every token as member-name.

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.

For object containers classify every token as member-name.

When to use this tool

Use JSON: JSON Pointer Numeric Key Vs Index when you need a pointer token, depth, or representation check.

How to use the tool and how it works

  1. Enter containerKind, token. 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 result. Expand result to inspect the returned fields.

For object containers classify every token as member-name. For arrays classify dash as append-position, canonical decimal tokens of at most nine digits as array-index, and others as invalid-array-index; return -1 unless a numeric array index applies.1

Input fieldMeaning and unitsAccepted input
containerKindContainer KindRequired. Text; one of "object", "array". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
tokenTokenRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.interpretationInterpretationCalculated result member: string.
result.indexNumeric array index or -1 for all nonnumeric and object-member cases.Calculated result member: number.
json
{
  "input": {
    "containerKind": "object",
    "token": "01"
  },
  "output": {
    "result": {
      "interpretation": "member-name",
      "index": -1
    }
  }
}

Limitations and assumptions

  • The token is already decoded; no array length or operation context is checked, and the digit cap is implementation specific.
  • Outputs are nested inside result. 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-numeric-key-vs-index — tool.io

Similar or alternative tools