JSON omit pointers
json-omit-pointers · version 1.0.0 · JSON & JSONL · free, no key needed
Deep-clone JSON and delete values at explicit RFC 6901 pointers.
Use when you need to: json omit pointers · remove json pointers · delete json pointers.
Supported
- json omit pointers
- remove json pointers
- delete json pointers
Not supported
- json patch document
- omit by regex
Behavior
- Accept only JSON values: null, boolean, finite number, string, array, and plain objects.
- Reject NaN, Infinity, -Infinity, undefined, BigInt, functions, symbols, Date, Map, Set, RegExp, boxed primitives, Buffer, and sparse holes.
- Canonicalize -0 to 0.
- Objects may have null or Object.prototype; use own enumerable string keys only.
- Treat __proto__, constructor, and toString as ordinary own keys. Never mutate Object.prototype.
- Output objects must be Object.create(null). Deep-clone all returned JSON values.
- Bound walk: max depth 32, max nodes 10000, max UTF-8 JSON bytes 250KiB of the input document string if provided as text; when json is already a value, bound the walked node count and depth.
- pointers is a non-empty unique list. Duplicate pointers are invalid_input.
- Reject the empty pointer (cannot omit root). Reject overlapping pointers where one is a prefix of another.
- Each pointer must exist (same rules as get). Delete own keys from objects; splice is not used for arrays: array holes are not allowed, so array index deletes compact the array by removing that index (subsequent indexes shift). To keep determinism, apply deletes from longest pointer / highest array index first after validating all exist on the original.
- Safer array policy: deleting an array index removes that element and compact the array. Multiple indexes into the same array are applied from highest index to lowest after validation against the original.
- Return { json: clone } with null-prototype objects throughout.
Input
json(any JSON value, required)pointers(array of string, required): min items 1; max items 256; each max length 1024
Output
json(any JSON value, required)
Limits
- max json depth: 32
- max json nodes: 10000
- max pointers: 256
- max pointer chars: 1024
Example
Request input:
{
"json": {
"a": 1,
"b": 2
},
"pointers": [
"/a"
]
}
Response:
{
"result": {
"json": {
"b": 2
}
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "json-omit-pointers",
"version": "1.0.0",
"input": {
"json": {
"a": 1,
"b": 2
},
"pointers": [
"/a"
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/json-omit-pointers/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"json":{"a":1,"b":2},"pointers":["/a"]}'
The machine-readable contract is at /v1/tools/json-omit-pointers/versions/1.0.0.
CLI
node cli.mjs run json-omit-pointers 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- JSON array drop keys: Remove specific keys from each object in a JSON array.
- JSON flatten: Flatten a JSON value into a null-prototype map keyed by RFC 6901 JSON Pointers.
- JSON pick pointers: Pick cloned JSON values at explicit RFC 6901 pointers into a null-prototype map.
- JSON pointer list: List RFC 6901 pointers to every reachable JSON node, root first.
- JSON unflatten: Reconstruct a JSON value from a map of RFC 6901 JSON Pointers to leaves.
- Array to JSONL: Serialize an array of JSON-safe values as JSON Lines text.