Library that generates TypeScript clients based on the OpenAPI specification. It supports various HTTP clients like Fetch, Axios, Node-Fetch, Angular, and XHR, and handles both OpenAPI v2.0 and v3.0 definitions in JSON or YAML formats. Key features included support for external references, abortable requests, and both CLI and programmatic generation. The last released version is 0.30.0. However, this package is now officially deprecated and no longer actively maintained due to time limitations from the original author. Users are strongly advised to migrate to `@hey-api/openapi-ts`, which is a maintained fork addressing previous issues and is under active development. All open PRs and issues for `openapi-typescript-codegen` were archived on May 1st, 2024, and the package is being deprecated on npm. There will be no further releases or official support for this package, making its release cadence effectively ceased.
npm install openapi-typescript-codegenVerified import paths — ran on the pinned version, not inferred.
Generates a TypeScript client using Axios for the Petstore API, placing generated files in `./generated` with custom service and model postfixes.
Migrate your projects to use `@hey-api/openapi-ts`. Refer to their migration guide for detailed instructions: `https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen`
Any new issues or feature requests should be directed to the `@hey-api/openapi-ts` project. Migrate to the fork for continued support and development.
Update your generation logic and consuming code if you relied on the deprecated enum model patterns. Ensure compatibility with the newer enum representation.
Upgrade to `openapi-typescript-codegen` v0.22.0 or newer if using Axios 0.27.x or later to ensure correct client generation.
If experiencing issues with external schema references, verify that your OpenAPI specification is compatible with the behavior of `json-schema-ref-parser` v10.1.0.
Provide the input path or URL using the `--input` (or `-i`) flag: `npx openapi --input ./spec.json --output ./generated`
Specify the output directory using the `--output` (or `-o`) flag: `npx openapi --input ./spec.json --output ./generated`
Ensure you are using `import { generate } from 'openapi-typescript-codegen';` for ESM. If in a CommonJS module, explicitly destructure, but consider that this package is deprecated and programmatic usage might be unstable; migration to `@hey-api/openapi-ts` is the long-term solution.No dependency data recorded yet.