Validators & Testers
Popular
Featured

JSON Schema Validator & Generator

Generate JSON Schema from sample JSON and validate payloads against required fields and basic types.

What is JSON Schema Validator & Generator?

Validate a JSON instance against a draft 2020-12 schema and generate an editable starting schema from observed data. Syntax validation and contract validation answer different questions.

How to use JSON Schema Validator & Generator?

Step 1

Paste representative JSON and review the generated draft schema.

Step 2

Paste or edit a schema to validate required fields and types.

Step 3

Copy the generated schema or validation summary for tests and documentation.

Example input / output

A schema requiring id as an integer with minimum 1 rejects {"id":0}, {"id":1.5} and {"id":"1"}. Array items, enum values and additional properties also require their own rules.

Example input

{"id":42,"name":"Ada","roles":["reader"],"active":true}

Check the result

  • Generated schemas are starting points; refine enums, formats, nullable fields, and business rules manually.
  • One sample cannot prove every optional field or array item variation.

Practical developer examples

Test a negative fixture

After a valid payload passes, remove a required property, change its type and add an unexpected field. Confirm each rejected case names the relevant instance location.

Review sample inference

A generated schema can only describe observed shapes. Required fields and additionalProperties=false are draft choices; edit them to match the published contract.

Common developer use cases

External schema references are not downloaded. Local references are supported. Business state, authorization and database constraints remain separate checks.

Common issues

Generated schemas are starting points; refine enums, formats, nullable fields, and business rules manually.
One sample cannot prove every optional field or array item variation.

FAQ

Is integer different from number?

Integer accepts numbers with no fractional part; number also accepts fractional values. A numeric string does not satisfy either type.

Can generated schemas prove all valid payloads?

No. Optional fields and unseen variants must be supplied from the actual API contract.