-
Notifications
You must be signed in to change notification settings - Fork 2
api‐zimic‐typegen
Diego Aquino edited this page Aug 19, 2024
·
1 revision
This module exports resources to generate types programmatically. We recommend using the
zimic typegen
CLI, but this is still a valid alternative for more advanced use cases.
An example using the programmatic API to generate types from an OpenAPI schema:
import { typegen } from 'zimic/typegen';
await typegen.generateFromOpenAPI({
input: './schema.yaml',
output: './schema.ts',
serviceName: 'MyService',
filters: ['* /users**'],
includeComments: true,
prune: true,
});
The options of typegen.generateFromOpenAPI(options)
are the same as the CLI options for the zimic typegen openapi
command.
See the zimic typegen
CLI reference.
© Zimic
npm |
Docs | Issues |
Examples | Roadmap
Help us improve these docs!
Report an issue or
edit on GitHub.