Toolstools.bryansuarez.dev

JSON to schema converter

Infer a JSON Schema from a sample, for structured outputs.

JSON Schema (2020-12)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer"
    },
    "title": {
      "type": "string"
    },
    "published": {
      "type": "string",
      "format": "date"
    },
    "author": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string",
          "format": "email"
        }
      },
      "required": [
        "name",
        "email"
      ]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "score": {
      "type": "number"
    }
  },
  "required": [
    "id",
    "title",
    "published",
    "author",
    "tags",
    "score"
  ]
}
A property is required only if every object in the sample has it. Give several example objects in an array for better results.

Runs in your browser. Nothing you enter is sent anywhere.