⚡
usefultools.dev
{S}

JSON Schema Generator from JSON Sample

NOVO

JSON 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.

Format
{"email":"[email protected]"}
"type":"string","format":"email"
Integer
{"age":31}
"type":"integer", required
Format
{"at":"2026-11-18T09:30:00Z"}
"format":"date-time"
Array
[1, 2.5]
"items":{"type":"number"}
Null
{"n":null}
"type":"null"
📖

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

1

Paste a JSON sample

Use a realistic document; arrays with several items give better results.

2

Pick the draft

Choose draft-07 or 2020-12 and optionally set a Title.

3

Tune options

Toggle Detect formats, Allow additional properties and Require every key.

4

Copy the schema

Click Copy or Download and review it before using it in production.

🤔

Perguntas frequentes