JSON Schema validator
Deterministic JSON Schema check of one JSON document: valid flag, sorted errors with JSON Pointer paths, a fixed keyword set with unsupported keywords refused, bounded regex, SHA-256 output digest.
$0.02
One call: the result comes back in the paid request.
Sample product output
{
"checked_nodes": 8,
"errors": [
{
"message": "number is below the minimum",
"path": "/age",
"rule": "minimum"
},
{
"message": "no value is allowed here",
"path": "/extra",
"rule": "additionalProperties"
},
{
"message": "string is shorter than the minimum length",
"path": "/name",
"rule": "minLength"
}
],
"limits": [
"Schema and instance: at most 16384 bytes each, nesting depth 32, 2000 JSON values each, decimal exponents within +/-1000; at most 20000 schema checks per call (each schema applied to a value, each required property and each value compared by enum or const counts).",
"Keywords: type, required, properties, additionalProperties, items (one schema), enum, const, minLength, maxLength, minimum, maximum, minItems, maxItems, pattern, anyOf, oneOf, allOf. Any other validating keyword, $ref included, is refused, never ignored. Numbers compare exactly.",
"pattern: Python re syntax, unanchored search, at most 128 characters and 2 quantifiers, repeat bounds at most 256, no groups with quantifiers, stacked quantifiers, backreferences, lookarounds or inline flags; tested strings at most 256 characters, at most 32 pattern tests per call.",
"At most 50 errors are returned, sorted by path, rule and message. Values are never echoed."
],
"output_sha256": "33b2a8121100b7a1042a3af2b16bcff8b3dd76aa5f1f110b76206b11ff4cf0b1",
"valid": false
}
Input fields
{
"properties": {
"instance": {
"description": "The JSON document to check, as JSON text.",
"example": "{\"name\":\"\",\"age\":-3,\"email\":\"a@example.com\",\"extra\":true}",
"maxLength": 16384,
"minLength": 1,
"type": "string"
},
"schema": {
"description": "JSON Schema as JSON text (supported keywords listed in the result's limits).",
"example": "{\"type\":\"object\",\"required\":[\"name\",\"age\",\"email\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"minLength\":1},\"age\":{\"type\":\"integer\",\"minimum\":0},\"email\":{\"type\":\"string\",\"pattern\":\"^[^@ ]+@[^@ ]+$\"}}}",
"maxLength": 16384,
"minLength": 1,
"type": "string"
}
},
"required": [
"schema",
"instance"
],
"type": "object"
}
One-step x402 buy
POST https://redwoodagentsupply.com/api/v1/buy/utility-json-schema-validate
Content-Type: application/json
{
"inputs": {
"schema": "{\"type\":\"object\",\"required\":[\"name\",\"age\",\"email\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"minLength\":1},\"age\":{\"type\":\"integer\",\"minimum\":0},\"email\":{\"type\":\"string\",\"pattern\":\"^[^@ ]+@[^@ ]+$\"}}}",
"instance": "{\"name\":\"\",\"age\":-3,\"email\":\"a@example.com\",\"extra\":true}"
}
}Paid orders settle before background work starts. A failed job is run again once, free and automatically. If it fails twice, ask the operator to run it again using the order ID. Keep your order credential private. All sales are final.
Assistant instructions
Read the catalog and request a quote using the example below. Create an order with that quote and a unique Idempotency-Key. Keep the order credential private. Send it as Bearer authorization. Request a payment attempt, then fetch the result after settlement.
Quote request example
POST /api/v1/quotes
Content-Type: application/json
{
"slug": "utility-json-schema-validate",
"inputs": {
"schema": "{\"type\":\"object\",\"required\":[\"name\",\"age\",\"email\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"type\":\"string\",\"minLength\":1},\"age\":{\"type\":\"integer\",\"minimum\":0},\"email\":{\"type\":\"string\",\"pattern\":\"^[^@ ]+@[^@ ]+$\"}}}",
"instance": "{\"name\":\"\",\"age\":-3,\"email\":\"a@example.com\",\"extra\":true}"
}
}