JSON pointer has
json-pointer-has · version 1.0.0 · JSON & JSONL · free, no key needed
Return whether an RFC 6901 pointer exists as an own path.
Use when you need to: json pointer has · has json pointer · json pointer exists.
Decide before calling
Read the versioned contract and the supported scope below. Reuse json-pointer-has@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use json-pointer-has@1.0.0 for json pointer has. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- json pointer has
- has json pointer
- json pointer exists
Not supported
- prototype has
- json patch
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.
- Same pointer grammar as json-pointer-get.
- present is true only if every token resolves through own properties or valid in-range array indexes.
- Invalid pointer syntax is invalid_input, not present false.
- Missing keys and out-of-range indexes yield present false. "-" is not present.
Input
json(any JSON value, required)pointer(string, required): max length 1024
Output
present(boolean, required)
Limits
- max json depth: 32
- max json nodes: 10000
- max pointer chars: 1024
Example
Request input:
{
"json": {
"a": [
1
]
},
"pointer": "/a/0"
}
Response:
{
"result": {
"present": true
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "json-pointer-has",
"version": "1.0.0",
"input": {
"json": {
"a": [
1
]
},
"pointer": "/a/0"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/json-pointer-has/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"json":{"a":[1]},"pointer":"/a/0"}'
The machine-readable contract is at /v1/tools/json-pointer-has/versions/1.0.0.
CLI
node cli.mjs run json-pointer-has 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- JSON flatten: Flatten a JSON value into a null-prototype map keyed by RFC 6901 JSON Pointers.
- JSON keyed array merge: Three-way merge JSON arrays by a JSON Pointer key, returning edits, moves, inserts, deletes, and conflicts.
- JSON pointer get: Return the cloned JSON value at an RFC 6901 pointer.
- JSON pointer list: List RFC 6901 pointers to every reachable JSON node, root first.
- JSON schema additional find: Find every member a JSON Schema 2020-12 "additionalProperties": false forbids, with the member's JSON Pointer.
- JSON schema batch validate: Validate many JSON records against one Draft 2020-12 subset schema; per-record validity, error pointers, counts.