JSON Schema generator

Paste sample records to infer a draft 2020-12 JSON Schema. Fields that appear in every record become required.

Input

No key required

Result

Example

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Cat",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "born": {
      "type": "string",
      "format": "date"
    },
    "owner": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      },
      "required": [
        "name",
        "email"
      ]
    }
  },
  "required": [
    "id",
    "name",
    "born",
    "owner"
  ]
}
Full response
{
  "to": "json-schema",
  "output": "{\n  \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n  \"title\": \"Cat\",\n  \"type\": \"object\",\n  \"properties\": {\n    \"id\": {\n      \"type\": \"integer\"\n    },\n    \"name\": {\n      \"type\": \"string\"\n    },\n    \"born\": {\n      \"type\": \"string\",\n      \"format\": \"date\"\n    },\n    \"owner\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"email\": {\n          \"type\": \"string\",\n          \"format\": \"email\"\n        }\n      },\n      \"required\": [\n        \"name\",\n        \"email\"\n      ]\n    }\n  },\n  \"required\": [\n    \"id\",\n    \"name\",\n    \"born\",\n    \"owner\"\n  ]\n}\n"
}

Run with curl

Copy this command to run the request in your terminal. It updates as you edit the input.

For higher limits, get a free API key and add -H "Authorization: Bearer $KAMINEKO_API_KEY".

POST /v1/types
curl 'https://api.kamineko.dev/v1/types' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "sample": {
    "id": 7,
    "name": "Mochi",
    "born": "2021-04-01",
    "owner": {
      "name": "Ada",
      "email": "ada@example.com"
    }
  },
  "name": "Cat",
  "to": "json-schema"
}'

Use with MCP

Set KAMINEKO_API_KEY to your key and run this command to connect Claude Code. Try the types tool with this prompt.

Write a JSON Schema for this config file.
MCP https://api.kamineko.dev/mcp
claude mcp add --transport http kamineko \
  https://api.kamineko.dev/mcp \
  --header "Authorization: Bearer $KAMINEKO_API_KEY"