JSON Schema Generator from JSON Sample
NOVOJSON Schema generator that infers draft-07 or 2020-12 schemas from a JSON sample: types, required keys, nested objects and string formats. Free, in-browser.
Funciona 100% no seu navegador — o que você insere nunca é enviado nem armazenado nos nossos servidores.
Esta ferramenta ainda não está totalmente traduzida, por isso parte do texto continua em inglês. A ferramenta funciona da mesma forma em todos os idiomas.
A key is required only when it appears in every object of the sample. Mixed values become a type list or anyOf.
Exemplos rápidos
Entradas típicas e os resultados que esta ferramenta gera.
Visão geral
A JSON Schema generator saves you from writing validation schemas by hand. Paste a representative JSON document and get a schema that describes its types, nested objects, array items and required keys, ready for Ajv, OpenAPI components or form generators.
Array items are merged into one item schema, so a key that is missing from some items is left out of "required", and mixed values become a type list such as ["string", "null"] or an anyOf. Whole numbers are typed as integer. Optional format detection adds email, date-time, date, uri and uuid when every sample value matches. You can target draft-07 or 2020-12 and forbid additional properties.
Everything runs in your browser, so sample data is never uploaded.
Por que usar esta ferramenta?
- Bootstrap a schema in seconds
- Required keys inferred from real samples
- Detects email, date-time, uri and uuid
- Draft-07 or 2020-12 output
- Private: runs locally
Recursos
Nested schemas
Objects and arrays are described recursively with properties and items.
Required keys
Keys present in every sample object go into "required".
Format detection
Adds format for email, date-time, date, uri and uuid strings.
Strict mode
Untick "Allow additional properties" to add additionalProperties: false.
Two drafts
Switch the $schema URI between draft-07 and 2020-12.
Copy or download
Copy the schema or save it as schema.json.
Como usar
Paste a JSON sample
Use a realistic document; arrays with several items give better results.
Pick the draft
Choose draft-07 or 2020-12 and optionally set a Title.
Tune options
Toggle Detect formats, Allow additional properties and Require every key.
Copy the schema
Click Copy or Download and review it before using it in production.