Skip to content

Main content

JSON Patch Add Root Replacement Token Tool

Calculate json patch add root replacement token from explicit caller-supplied inputs.

Loading tool…

Description

Require path empty or slash prefixed and set replacesDocument only for the empty root path.

JSON Patch describes operations at pointer locations, and operation context determines whether a location is usable. Array append tokens, root targets, and scalar equality have narrow semantics.

Require path empty or slash prefixed and set replacesDocument only for the empty root path.

When to use this tool

Use JSON Patch Add Root Replacement Token when you need one explicit patch-context check.

How to use the tool and how it works

  1. Enter path. 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 replacesDocument. Inspect replacesDocument before interpreting the associated values.

Require path empty or slash prefixed and set replacesDocument only for the empty root path.1

Input fieldMeaning and unitsAccepted input
pathPathRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
replacesDocumentReplaces DocumentRequired. Boolean.
json
{
  "input": {
    "path": ""
  },
  "output": {
    "replacesDocument": true
  }
}

Limitations and assumptions

  • This describes root targeting for add without validating pointer escapes, input data, or an actual replacement.
  • 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

Validate and apply the full patch transaction against the actual document using a conforming implementation.

References

  1. Calculation and input contract: json/json-patch-add-root-replacement-token — tool.io

Similar or alternative tools