{
  "slug": "openapi-to-fetch-client",
  "name": "gizza-ai/openapi-to-fetch-client",
  "version": "0.1.0",
  "title": "OpenAPI to Fetch Client — TypeScript Generator — gizza.ai",
  "description": "Generate a self-contained typed TypeScript fetch client from an OpenAPI or Swagger paths spec, with functions or a class and configurable error style.",
  "tags": [
    "openapi client",
    "typescript fetch",
    "swagger client",
    "api client generator",
    "openapi typescript",
    "fetch wrapper",
    "typed api",
    "code generator",
    "rest client",
    "openapi paths"
  ],
  "category": "developer",
  "urls": {
    "page": "https://gizza.ai/tools/openapi-to-fetch-client/",
    "markdown": "https://gizza.ai/tools/openapi-to-fetch-client/index.md",
    "descriptor": "https://gizza.ai/tools/openapi-to-fetch-client/tool.json",
    "deep_link_example": "https://gizza.ai/tools/openapi-to-fetch-client/?spec=openapi%3A%203.1.0%0Aservers%3A%0A%20%20-%20url%3A%20https%3A%2F%2Fapi.example.com%0Apaths%3A%0A%20%20%2Fpets%2F%7BpetId%7D%3A%0A%20%20%20%20get%3A%0A%20%20%20%20%20%20operationId%3A%20getPet%0A%20%20%20%20%20%20parameters%3A%0A%20%20%20%20%20%20%20%20-%20name%3A%20petId%0A%20%20%20%20%20%20%20%20%20%20in%3A%20path%0A%20%20%20%20%20%20%20%20%20%20required%3A%20true%0A%20%20%20%20%20%20%20%20%20%20schema%3A%20%7B%20type%3A%20string%20%7D%0A%20%20%20%20%20%20responses%3A%0A%20%20%20%20%20%20%20%20%27200%27%3A%0A%20%20%20%20%20%20%20%20%20%20description%3A%20OK&input_format=auto&style=functions&client_name=ApiClient&naming=operation_id&param_style=object&error_handling=throw&base_url=https%3A%2F%2Fapi.example.com%2Fv1&types_module=.%2Ftypes&tags=pets%2C%20admin&jsdoc=true&indent=2"
  },
  "cli": "gizza tool openapi-to-fetch-client \"openapi: 3.1.0\nservers:\n  - url: https://api.example.com\npaths:\n  /pets/{petId}:\n    get:\n      operationId: getPet\n      parameters:\n        - name: petId\n          in: path\n          required: true\n          schema: { type: string }\n      responses:\n        '200':\n          description: OK\"",
  "tool": {
    "description": "Turn an OpenAPI 3.x or Swagger 2.0 JSON/YAML document into a dependency-free TypeScript fetch client. It walks paths and operations, emits exported functions or a client class, substitutes path params, serializes query/header params, wires request bodies and response types from local schema refs, and supports throw-style ApiError or result-union error handling. It does not generate model files or fetch remote refs; point types_module at a sibling schema-types file or leave it blank for placeholder aliases.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "base_url": {
          "default": "",
          "description": "Base URL baked into the generated client. Blank uses servers[0].url for OpenAPI 3.x or scheme/host/basePath for Swagger 2.0, then an empty string.",
          "type": "string"
        },
        "client_name": {
          "default": "ApiClient",
          "description": "Class name when style=class. Ignored for function output. Default ApiClient.",
          "type": "string"
        },
        "error_handling": {
          "default": "throw",
          "description": "Non-2xx handling: throw emits an ApiError class and throws; result resolves to an ApiResult<T> union with data or error.",
          "enum": [
            "throw",
            "result"
          ],
          "type": "string"
        },
        "indent": {
          "default": 2,
          "description": "Spaces per indentation level in the generated TypeScript (0-8). Default 2.",
          "maximum": 8,
          "minimum": 0,
          "type": "integer"
        },
        "input_format": {
          "default": "auto",
          "description": "How to parse spec: auto (try JSON then YAML), json, or yaml. Default auto.",
          "enum": [
            "auto",
            "json",
            "yaml"
          ],
          "type": "string"
        },
        "jsdoc": {
          "default": true,
          "description": "Include JSDoc comments from operation summaries/descriptions and parameter descriptions. Default true.",
          "type": "boolean"
        },
        "naming": {
          "default": "operation_id",
          "description": "Function naming: operation_id uses operationId when present and falls back to method+path; path always derives names from method+path.",
          "enum": [
            "operation_id",
            "path"
          ],
          "type": "string"
        },
        "param_style": {
          "default": "object",
          "description": "Call signature style: object emits one typed request object per operation; positional emits path params, then body, then a query/header object.",
          "enum": [
            "object",
            "positional"
          ],
          "type": "string"
        },
        "spec": {
          "description": "OpenAPI 3.x or Swagger 2.0 document as JSON or YAML. The tool reads the paths object and emits one typed fetch call per operation.",
          "type": "string"
        },
        "style": {
          "default": "functions",
          "description": "Output shape: exported functions (default) or one exported client class.",
          "enum": [
            "functions",
            "class"
          ],
          "type": "string"
        },
        "tags": {
          "default": "",
          "description": "Optional comma-separated tag filter. Blank generates every operation; a non-empty filter keeps operations whose tags match.",
          "type": "string"
        },
        "types_module": {
          "default": "./types",
          "description": "Module to import local schema types from, e.g. ./types. Blank emits placeholder type aliases so the file stays standalone.",
          "type": "string"
        }
      },
      "required": [
        "spec"
      ],
      "type": "object"
    }
  }
}