🧑‍💻

JSON Schema Generator

Generate a draft-07 JSON Schema from a sample.

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

Inferred from one sample: every field is marked required. Loosen it by hand for optional fields.

Related Developer tools