JSON Schema validation
Validate caller-supplied JSON against a bounded JSON Schema Draft 2020-12 contract with deterministic error pointers, format checks, input fingerprints, and no remote reference resolution.
$0.01 USDCBasex402 v2POST
Endpoint
https://apiacre.com/v1/data/schema-validateSend the JSON body below. An unpaid request returns HTTP 402 with a PAYMENT-REQUIRED header; an x402-compatible buyer signs the requirement and retries with PAYMENT-SIGNATURE.
Input example
{
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"score": {
"type": "integer",
"minimum": 0
}
},
"required": [
"name",
"score"
],
"additionalProperties": false
},
"instance": {
"name": "Ada",
"score": "98"
},
"max_errors": 25,
"check_formats": true
}Response shape
{
"request_id": "018f1f54-7f38-7ba2-8dc3-5f90272d9f1a",
"service": "data.schema-validate",
"version": "1",
"data": {
"valid": false,
"schemaValid": true,
"instanceValid": false,
"errorCount": 1,
"errorCountExact": true,
"errorsReturned": 1,
"errorsTruncated": false,
"errors": [
{
"kind": "instance",
"instancePath": "/score",
"schemaPath": "/properties/score/type",
"keyword": "type",
"message": "'98' is not of type 'integer'"
}
],
"schema": {
"dialect": "https://json-schema.org/draft/2020-12/schema",
"declaredDialect": "https://json-schema.org/draft/2020-12/schema",
"utf8Bytes": 224,
"sha256": "9565a3dfc9aaadfaf2b3163f433b954d7d91246b6c225c11a8c16fe42ae841e4",
"remoteReferencesAllowed": false
},
"instance": {
"utf8Bytes": 27,
"sha256": "43d117eb76b608a0d05820c70320889a6577ff85446e00412b6e6487c1559149"
},
"validation": {
"engine": "python-jsonschema",
"engineVersion": "4.26.0",
"draft": "2020-12",
"formatChecking": true,
"maxErrors": 25,
"networkRequestsMade": false
}
},
"meta": {
"duration_ms": 42,
"cached": false,
"sources": [],
"warnings": [],
"next_actions": []
}
}Try the payment challenge
curl -i -X POST 'https://apiacre.com/v1/data/schema-validate' \
-H 'content-type: application/json' \
--data '{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1},"score":{"type":"integer","minimum":0}},"required":["name","score"],"additionalProperties":false},"instance":{"name":"Ada","score":"98"},"max_errors":25,"check_formats":true}'