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
- Enter path. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| path | Path | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| replacesDocument | Replaces Document | Required. Boolean. |
{
"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
Similar or alternative tools
- JSON Patch Root Remove Context
Validate the operation and rootRemovalPolicy tokens.
- JSON Object Single Member Wrapper
Parse valueJson and wrap it under the literal key using a computed object property.