AZ Tools

JSON Schema Generator

Developer

Walks the JSON you paste, infers types (integer / number / string / boolean / null / array / object), spots common string formats (email, URI, UUID, IPv4, date, date-time), and emits a JSON Schema you can use for validation. Optionally marks every property as required and embeds the value as an `examples` entry.

JSON Schema (draft-07)
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "verified": {
          "type": "boolean"
        },
        "roles": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "address": {
          "type": "object",
          "properties": {
            "street": {
              "type": "string"
            },
            "city": {
              "type": "string"
            }
          },
          "required": [
            "street",
            "city"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "email",
        "verified",
        "roles",
        "address"
      ]
    }
  },
  "required": [
    "user"
  ]
}

How to use

  1. Paste a JSON sample in the input box.
  2. Pick whether all properties should be required (best for strict API contracts) or only the keys that exist (good for partial / patch payloads).
  3. Optionally include the value as `examples` so generated docs show a sample alongside the type.

Frequently asked questions

Which draft does it target?
draft-07 — the most widely supported version across validators, code generators, and editor tooling like Stoplight or Redocly. The output is also compatible with the JSON Schema fragment used by OpenAPI 3.0.
How does it handle mixed-type arrays?
If every element produces the same schema, the `items` is collapsed to that schema. If elements differ, `items.type` becomes a union (`['string', 'integer']`). The tool doesn't generate `anyOf` / `oneOf` — it stays as simple as possible.
Which string formats are auto-detected?
`date-time`, `date`, `email`, `uri`, `uuid`, `ipv4`. The match must be on the entire string, not a substring.
What about nullable fields?
A null value in the input becomes `"type": "null"`. For optional-nullable fields, run the generator on representative samples and merge — the tool keeps the schema minimal rather than guessing.

Related tools