JSON Pointer Rebase Tool
Rebase an RFC 6901 pointer by replacing a decoded-token prefix; reject paths outside the old base.
Description
Rebase an RFC 6901 pointer by replacing a decoded-token prefix; reject paths outside the old base.
Moving a subtree changes the prefix of pointers beneath it. Rebasing on decoded tokens avoids confusing a property-name prefix with a complete path component.
When to use this tool
Rebase an RFC 6901 pointer by replacing a decoded-token prefix; reject paths outside the old base.
- Prepare the supplied pointer, oldBase, newBase fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter pointer, oldBase, newBase. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.pointer. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Parse pointer, oldBase and newBase as JSON Pointers. Require oldBase's decoded tokens to prefix pointer's tokens, replace that prefix with newBase's tokens, then escape and format the result.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| pointer | pointer. | Text; at most 8,192 UTF-16 code units, subject to the grammar above |
| oldBase | old base. | Text; at most 8,192 UTF-16 code units, subject to the grammar above |
| newBase | new base. | Text; at most 8,192 UTF-16 code units, subject to the grammar above |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.pointer | The pointer value under the stated formula or text convention. |
{
"input": {
"pointer": "/a/b",
"oldBase": "/a",
"newBase": "/x"
},
"output": {
"result": {
"pointer": "/x/b"
}
}
} Limitations and assumptions
- A nonmatching old base is an input error. Empty text denotes the root; string-prefix matching, URI decoding and document existence checks are not performed.
- Decoded JSON is bounded to 20,000 nodes and 32 nesting levels; record arrays have at most 128 records. Parsed number values use JavaScript floating point rather than arbitrary-precision decimal arithmetic.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- Ordinary string lists have at most 128 entries of at most 128 code units each; numeric lists and matrices have separate bounded size checks. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
For document-wide requirements, combine these structural inventories with an explicit JSON Schema. Preserve the distinction between missing properties and null values, and between numbers and numeric-looking strings when building joins or indexes.
References
Similar or alternative tools
- pointer
Resolve an RFC 6901 JSON Pointer against a document and report the located value.
- JSON Pointer Array Index Token Check
Audit a decoded JSON Pointer array index token: canonical decimal, safe integer, in-range and optional append marker are distinct checks.