generate-typescript-types
Create TypeScript type definitions from Swagger/OpenAPI documents. Specify custom settings like file prefix, namespace, and strict types to streamline API integration.
Instructions
Generate TypeScript type definitions from Swagger/OpenAPI document.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cacheTTLMinutes | No | Cache TTL in minutes | |
| excludeSchemas | No | Array of schema names to exclude | |
| filePrefix | No | File prefix | |
| fileSuffix | No | File suffix | |
| generateEnums | No | Whether to generate enum types | |
| generateIndex | No | Whether to generate an index file | |
| headers | No | Request headers | |
| includeSchemas | No | Array of schema names to include | |
| lazyLoading | No | Whether to use lazy loading | |
| namespace | No | Namespace name | |
| outputDir | No | Output directory | |
| overwrite | No | Whether to overwrite existing files | |
| skipValidation | No | Whether to skip validation | |
| strictTypes | No | Whether to use strict types | |
| swaggerUrl | Yes | Swagger/OpenAPI document URL | |
| useCache | No | Whether to use cache | |
| useNamespace | No | Whether to use namespace for wrapping types |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"cacheTTLMinutes": {
"description": "Cache TTL in minutes",
"type": "number"
},
"excludeSchemas": {
"description": "Array of schema names to exclude",
"items": {
"type": "string"
},
"type": "array"
},
"filePrefix": {
"description": "File prefix",
"type": "string"
},
"fileSuffix": {
"description": "File suffix",
"type": "string"
},
"generateEnums": {
"description": "Whether to generate enum types",
"type": "boolean"
},
"generateIndex": {
"description": "Whether to generate an index file",
"type": "boolean"
},
"headers": {
"additionalProperties": {
"type": "string"
},
"description": "Request headers",
"type": "object"
},
"includeSchemas": {
"description": "Array of schema names to include",
"items": {
"type": "string"
},
"type": "array"
},
"lazyLoading": {
"description": "Whether to use lazy loading",
"type": "boolean"
},
"namespace": {
"description": "Namespace name",
"type": "string"
},
"outputDir": {
"description": "Output directory",
"type": "string"
},
"overwrite": {
"description": "Whether to overwrite existing files",
"type": "boolean"
},
"skipValidation": {
"description": "Whether to skip validation",
"type": "boolean"
},
"strictTypes": {
"description": "Whether to use strict types",
"type": "boolean"
},
"swaggerUrl": {
"description": "Swagger/OpenAPI document URL",
"type": "string"
},
"useCache": {
"description": "Whether to use cache",
"type": "boolean"
},
"useNamespace": {
"description": "Whether to use namespace for wrapping types",
"type": "boolean"
}
},
"required": [
"swaggerUrl"
],
"type": "object"
}