{
  "slug": "openapi-to-typescript-types",
  "name": "gizza-ai/openapi-to-typescript-types",
  "version": "0.1.0",
  "title": "OpenAPI to TypeScript Types Generator — gizza.ai",
  "description": "Turn an OpenAPI 3.x or Swagger 2.0 schema into TypeScript types in your browser — paste JSON or YAML, get interfaces or type aliases with refs and enums handled.",
  "tags": [
    "openapi to typescript",
    "swagger to typescript types",
    "openapi typescript generator",
    "openapi schema to interface",
    "json schema to typescript",
    "components schemas to typescript",
    "openapi 3.1 typescript",
    "generate typescript from openapi"
  ],
  "category": "developer",
  "urls": {
    "page": "https://gizza.ai/tools/openapi-to-typescript-types/",
    "markdown": "https://gizza.ai/tools/openapi-to-typescript-types/index.md",
    "descriptor": "https://gizza.ai/tools/openapi-to-typescript-types/tool.json",
    "deep_link_example": "https://gizza.ai/tools/openapi-to-typescript-types/?spec=openapi%3A%20%223.0.3%22%0Acomponents%3A%0A%20%20schemas%3A%0A%20%20%20%20User%3A%0A%20%20%20%20%20%20type%3A%20object%0A%20%20%20%20%20%20required%3A%20%5Bid%5D%0A%20%20%20%20%20%20properties%3A%0A%20%20%20%20%20%20%20%20id%3A%20%7B%20type%3A%20integer%20%7D%0A%20%20%20%20%20%20%20%20name%3A%20%7B%20type%3A%20string%20%7D&input_format=auto&declaration=interface&enum_style=union&optional_style=spec&export=true&readonly=true&sort=true&indent=2"
  },
  "cli": "gizza tool openapi-to-typescript-types 'openapi: \"3.0.3\"\ncomponents:\n  schemas:\n    User:\n      type: object\n      required: [id]\n      properties:\n        id: { type: integer }\n        name: { type: string }'",
  "tool": {
    "description": "Extract the schema objects from an OpenAPI 3.x (components.schemas) or Swagger 2.0 (definitions) document and emit matching TypeScript type declarations. Accepts JSON or YAML (input_format='auto' by default). Handles $ref (as named type references), type (incl. 3.1 type arrays like [\"string\",\"null\"]), enum, const, nullable, required, properties, additionalProperties (index signatures), array items, tuple items/prefixItems, and allOf/oneOf/anyOf (intersection/union); descriptions become JSDoc comments. Choose declaration='interface' (default) or 'type' for object schemas, enum_style='union' (default) or 'enum', optional_style='spec'/'optional'/'required', plus export, readonly, sort, and indent. Returns the TypeScript source.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "declaration": {
          "default": "interface",
          "description": "How to declare object schemas: 'interface' (default, `export interface X { … }`) or 'type' (`export type X = { … }`). Non-object schemas are always type aliases.",
          "enum": [
            "interface",
            "type"
          ],
          "type": "string"
        },
        "enum_style": {
          "default": "union",
          "description": "How to render a schema whose values are a string 'enum': 'union' (default, a `\"a\" | \"b\"` string-literal union) or 'enum' (a real TypeScript `enum`).",
          "enum": [
            "union",
            "enum"
          ],
          "type": "string"
        },
        "export": {
          "default": true,
          "description": "Prefix every declaration with `export` (default true). Set false for plain, non-exported declarations.",
          "type": "boolean"
        },
        "indent": {
          "default": 2,
          "description": "Number of spaces per nesting level, 0-8. Default 2.",
          "maximum": 8,
          "minimum": 0,
          "type": "integer"
        },
        "input_format": {
          "default": "auto",
          "description": "How to parse the input. 'auto' (default) tries JSON then YAML; force 'json' or 'yaml' to control the error message.",
          "enum": [
            "auto",
            "json",
            "yaml"
          ],
          "type": "string"
        },
        "optional_style": {
          "default": "spec",
          "description": "How property optionality is decided: 'spec' (default, mark a property optional `?` unless it is in the schema's `required` array), 'optional' (every property `?`), or 'required' (no property is optional).",
          "enum": [
            "spec",
            "optional",
            "required"
          ],
          "type": "string"
        },
        "readonly": {
          "default": false,
          "description": "Mark every object property and index signature `readonly` (default false).",
          "type": "boolean"
        },
        "sort": {
          "default": false,
          "description": "Alphabetize object properties (default false, which preserves the document's own key order).",
          "type": "boolean"
        },
        "spec": {
          "description": "The OpenAPI 3.x or Swagger 2.0 document to read, as JSON or YAML text. Types are generated from its components/schemas (3.x) or definitions (2.0) object.",
          "type": "string"
        }
      },
      "required": [
        "spec"
      ],
      "type": "object"
    }
  }
}