ZapKit

JSON Schema generator

Start an API contract or validation rule from real data: paste a sample and get a JSON Schema you can refine instead of writing it by hand.

What is a JSON Schema generator?

A JSON Schema generator infers a schema, a formal description of a JSON document's structure, from example data. JSON Schema is used to validate API requests and responses, document data formats, generate forms and types, and catch bad input before it reaches your code.

Paste a sample to get a draft 2020-12 schema with types, nested properties and array item schemas. Options detect string formats, mark fields as required, forbid unexpected properties, add a title, and treat a top-level array as a set of samples to merge.

How to use the JSON Schema generator

  1. 1.Paste sample JSON

    One object, or an array of several samples.

  2. 2.Pick options

    Formats, required fields, extra properties and a title.

  3. 3.Copy or download

    Save schema.json and refine it.

Example: a user record

One user with id, name, email, age, joined, tags, address and manager:

id
string, format uuid
email / joined
format email / format date-time
age / tags
integer / array of strings
manager
type null (add other types if it can be set)

A complete schema in one step, ready to tighten with real limits.

Inference from examples

Every value's type is recorded, objects become nested properties, and arrays get a schema for their items. With several samples, properties found in all of them are marked required, and types that differ are combined, so a field that is sometimes null becomes ["string", "null"].

Format detection recognises strings that are all email addresses, dates, date-times, times, URLs, UUIDs or IPv4 addresses. A generated schema reflects only the samples you gave it, so add limits such as minimum, maxLength or enum by hand where your rules are stricter.

Frequently asked questions

Which draft does it use?

Draft 2020-12, the current version, which most validators support.

How do I give several samples?

Paste an array of objects and tick Treat a top-level array as several samples.

What does disallowing extra properties do?

It adds additionalProperties: false, so unknown keys fail validation.

Is my data uploaded?

No. The schema is generated locally.

More Developer tools