@goast/typescript
v0.4.1
Published
Provides gOAst generators for generating TypeScript code from OpenAPI specifications.
Downloads
2,042
Readme
gOAst (@goast/typescript)
gOAst stands for generative Open API specification transformer, a tool designed to transform OpenAPI specifications into various forms with flexibility and extensibility at its core.
For more Information, please visit the gOAst GitHub Repository.
Purpose 👍
The @goast/typescript
package provides generators for TypeScript code generation
from OpenAPI specifications.
Usage Example 🚀
import { OpenApiGenerator } from '@goast/core';
import { TypeScriptFetchClientsGenerator, TypeScriptModelsGenerator } from '@goast/typescript';
async function main() {
await new OpenApiGenerator({ outputDir: '.api' })
.useType(TypeScriptModelsGenerator)
.useType(TypeScriptFetchClientsGenerator)
.parseAndGenerateFromDir('.openapi');
}
main();
Available Generators 📚
TypeScriptModelsGenerator
: Generates TypeScript interfaces or types from schemas in the OpenAPI specification(s).TypeScriptFetchClientsGenerator
: Generates Fetch clients for TypeScript from paths in the OpenAPI specification(s).- Depends on the output of the
TypeScriptModelsGenerator
generator.
- Depends on the output of the
TypeScriptAngularServicesGenerator
: Generates Angular services from paths in the OpenAPI specification(s).- Depends on the output of the
TypeScriptModelsGenerator
generator.
- Depends on the output of the
TypeScriptEasyNetworkStubsGenerator
: Generates easy-network-stub classes from paths in the OpenAPI specification(s).- Depends on the output of the
TypeScriptModelsGenerator
generator.
- Depends on the output of the
TypeScriptK6ClientsGenerator
: Generates k6 clients from paths in the OpenAPI specification(s).- Depends on the output of the
TypeScriptModelsGenerator
generator.
- Depends on the output of the
API Documentation 📖
The API documentation can be found here.