generate-api-client
Create API client code in TypeScript for Axios, Fetch, or React Query from any Swagger/OpenAPI document. Customize output directory, file structure, and tags for efficient integration.
Instructions
Generate API client code from Swagger/OpenAPI document.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
clientType | No | API client technology stack | |
excludeTags | No | Exclude tags filter | |
filePrefix | No | File prefix | |
fileSuffix | No | File suffix | |
generateTypeImports | No | Whether to generate type imports | |
groupBy | No | Grouping method | |
headers | No | Request headers | |
includeTags | No | Include tags filter | |
outputDir | No | Output directory | |
overwrite | No | Whether to overwrite existing files | |
swaggerUrl | Yes | Swagger/OpenAPI document URL | |
typesImportPath | No | Types import path |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"clientType": {
"description": "API client technology stack",
"enum": [
"axios",
"fetch",
"react-query"
],
"type": "string"
},
"excludeTags": {
"description": "Exclude tags filter",
"items": {
"type": "string"
},
"type": "array"
},
"filePrefix": {
"description": "File prefix",
"type": "string"
},
"fileSuffix": {
"description": "File suffix",
"type": "string"
},
"generateTypeImports": {
"description": "Whether to generate type imports",
"type": "boolean"
},
"groupBy": {
"description": "Grouping method",
"enum": [
"tag",
"path",
"none"
],
"type": "string"
},
"headers": {
"additionalProperties": {
"type": "string"
},
"description": "Request headers",
"type": "object"
},
"includeTags": {
"description": "Include tags filter",
"items": {
"type": "string"
},
"type": "array"
},
"outputDir": {
"description": "Output directory",
"type": "string"
},
"overwrite": {
"description": "Whether to overwrite existing files",
"type": "boolean"
},
"swaggerUrl": {
"description": "Swagger/OpenAPI document URL",
"type": "string"
},
"typesImportPath": {
"description": "Types import path",
"type": "string"
}
},
"required": [
"swaggerUrl"
],
"type": "object"
}