JSON Schema validator
Validate JSON against a JSON Schema and list every violation with its location.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/json-schema-validate \
-H 'Content-Type: application/json' \
-d '{"input":{"text":"{\"name\":\"Sam\",\"age\":\"31\"}","schema":"{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"age\":{\"type\":\"integer\"}}}"}}'
import json, urllib.request
body = {'input': {'text': '{"name":"Sam","age":"31"}', 'schema': '{"type":"object","required":["name","age"],"properties":{"age":{"type":"integer"}}}'}}
request = urllib.request.Request("https://setget.net/v1/tools/json-schema-validate", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/json-schema-validate", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"text":"{\"name\":\"Sam\",\"age\":\"31\"}","schema":"{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"age\":{\"type\":\"integer\"}}}"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "json-schema-validate",
"input": {
"text": "{\"name\":\"Sam\",\"age\":\"31\"}",
"schema": "{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"age\":{\"type\":\"integer\"}}}"
}
}
{
"input": {
"text": "{\"name\":\"Sam\",\"age\":\"31\"}",
"schema": "{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"age\":{\"type\":\"integer\"}}}"
}
}
Endpoint: POST /v1/tools/json-schema-validate. Over MCP: run_tool with slug: "json-schema-validate".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
text |
string | yes | The JSON document to validate. |
schema |
string | yes | The JSON Schema. |
Examples
Input
{
"text": "{\"name\":\"Sam\",\"age\":\"31\"}",
"schema": "{\"type\":\"object\",\"required\":[\"name\",\"age\"],\"properties\":{\"age\":{\"type\":\"integer\"}}}"
}Result
{
"valid": false,
"errors": [
{
"path": "$.age",
"message": "'31' is not of type 'integer'",
"rule": "type"
}
]
}A valid document
Input
{
"text": "{\"name\":\"Sam\",\"age\":31}",
"schema": "{\"type\":\"object\",\"required\":[\"name\"]}"
}Result
{
"valid": true,
"errors": []
}Questions
- Which schema drafts work?
- The draft named in "$schema" is used. Without one, the latest draft (2020-12) applies.
- Are remote $ref URLs fetched?
- No. This tool never makes network requests, so every $ref must point inside the schema.
Related tools
- JSON Schema generatorGenerate a JSON Schema from example JSON. Arrays of objects are merged into one item shape.
json-schema-infer - JSON validatorCheck whether text is valid JSON and get the exact line and column of the first error.
json-validate - .env to JSONParse a .env file into a JSON object, handling quotes, comments and "export" prefixes.
env-to-json - CSV profilerSummarise each CSV column: type, blanks, distinct values, min, max, mean and top values.
csv-profile - CSV sort, filter and dedupeSort CSV by a column, keep rows containing some text, pick columns and remove duplicate rows.
csv-sort-filter-dedupe - CSV to JSONTurn CSV rows into a JSON array of objects, detecting numbers, booleans and blanks.
csv-to-json