JSON Schema 校验
按 JSON Schema 校验文档
JSON Data
JSON Schema
Enforce a JSON contract, not just JSON syntax
Syntax validation tells you the document parses. Schema validation tells you it actually has the fields, types, and constraints your code expects. That matters most when JSON is crossing a boundary — between services, between a model and your code, or between a partner system and yours — where a missing field becomes a production incident.
Use the validator when you need to
Validate API request and response bodies
Check that incoming and outgoing payloads match the contract before they reach business logic.
Validate AI structured outputs
Confirm that model responses, tool calls, or agent JSON match the shape your downstream code requires.
Run schema checks in CI on fixtures
Fail builds when sample payloads or fixtures drift away from the documented contract.
How to validate JSON against a schema
- 1
Paste your JSON document into the data editor.
- 2
Paste your JSON Schema (Draft 2020-12) into the schema editor.
- 3
Click Validate and review the path-by-path errors if validation fails.
Keep going
Generate a schema from a sample
Skip writing a schema from scratch — generate one from a known-good document.
Validate LLM output
Combine repair and schema validation when the input is model JSON.
Just check syntax
Confirm the document parses before running schema validation against it.
Build a provider schema
Wrap a schema for OpenAI, Anthropic, or MCP integrations.
Common schema-validation workflows
Reject any request body that doesn't match the schema before it touches downstream services.
Validate structured AI responses against the schema your handler expects.
Run validation on test fixtures so changes to the contract surface immediately.
相关工具
Structured Output Schema Builder
Generate OpenAI, Anthropic, MCP, or plain JSON Schema wrappers from sample output
JSON Schema 生成
根据示例 JSON 生成 JSON Schema
LLM JSON Output Validator
Repair and validate model JSON output against a schema
MCP Tool Schema Validator
Validate MCP tool definitions and verify `inputSchema` before deployment
常见问题
左侧粘贴 JSON 数据,右侧粘贴 JSON Schema,然后点击 Validate。工具会逐条检查 schema 里的约束,并把所有校验错误按精确路径列出来。
支持 JSON Schema Draft 2020-12 的全部特性,包括类型检查、required、pattern、minimum/maximum、数组 items 校验、allOf/anyOf/oneOf 组合器,以及 $ref 引用。
每条错误都会包含:数据路径(错在哪里)、schema 路径(哪条规则失败了)以及可读的错误说明。例如:/users/0/email must match format "email"。
可以。如果你有 OpenAPI/Swagger 规范,先把对应的 schema 定义提取出来粘贴到 Schema 编辑器,再把一份请求体样例粘贴到 JSON 编辑器,就能验证是否满足所有要求。