Skip to content

Main content

JSON Patch Root Remove Context Tool

Identify root removal and evaluate an explicit application policy for representing document absence. No JSON value is substituted for an absent document.

Loading tool…

Description

Validate the operation and rootRemovalPolicy tokens.

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.

Validate the operation and rootRemovalPolicy tokens.

When to use this tool

Use JSON Patch Root Remove Context when you need one explicit patch-context check.

How to use the tool and how it works

  1. Enter path, operation, rootPresent, rootRemovalPolicy. 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 removesDocument, applicable. Inspect removesDocument, applicable before interpreting the associated values.

Validate the operation and rootRemovalPolicy tokens. removesDocument requires remove at an empty path; applicable additionally requires rootPresent and allow-document-absence policy.1

Input fieldMeaning and unitsAccepted input
pathPathRequired. Text; maximum UTF-16 length 8192.
operationOperationRequired. Text; one of "remove", "add", "replace", "test", "copy", "move"; maximum UTF-16 length 8192.
rootPresentRoot PresentRequired. Boolean.
rootRemovalPolicyRoot Removal PolicyRequired. Text; one of "allow-document-absence", "reject"; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
removesDocumentRemoves DocumentRequired. Boolean.
applicableWhether the supplied flags allow this specific root-remove case; false for other operations.Required. Boolean.
json
{
  "input": {
    "path": "",
    "operation": "remove",
    "rootPresent": true,
    "rootRemovalPolicy": "allow-document-absence"
  },
  "output": {
    "removesDocument": true,
    "applicable": true
  }
}

Limitations and assumptions

  • Applicable describes only this root-removal case and is false for other operations; no patch or root value is changed.
  • 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-root-remove-context — tool.io

Similar or alternative tools