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
- Enter path, operation, rootPresent, rootRemovalPolicy. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| path | Path | Required. Text; maximum UTF-16 length 8192. |
| operation | Operation | Required. Text; one of "remove", "add", "replace", "test", "copy", "move"; maximum UTF-16 length 8192. |
| rootPresent | Root Present | Required. Boolean. |
| rootRemovalPolicy | Root Removal Policy | Required. Text; one of "allow-document-absence", "reject"; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| removesDocument | Removes Document | Required. Boolean. |
| applicable | Whether the supplied flags allow this specific root-remove case; false for other operations. | Required. Boolean. |
{
"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
Similar or alternative tools
- JSON Patch Add Root Replacement Token
Require path empty or slash prefixed and set replacesDocument only for the empty root path.
- JSON Patch Array Append Context Check
Mark append for token dash.