Library that generates Typescript clients based on the OpenAPI specification.
npm install @oskarasplin/openapi-typescript-codegenThis is a fork of the original OpenAPI Typescript Codegen library. It is only meant as a temprorary npm package to use until these feature requests are merged into the original repo:
- https://github.com/ferdikoomen/openapi-typescript-codegen/pull/1465
- https://github.com/ferdikoomen/openapi-typescript-codegen/pull/1145
To install this fork: npm install @oskarasplin/openapi-typescript-codegen
At the time of writing the feature/omit-read-only branch is published as the latest npm version
Original ReadMe below
> [!IMPORTANT]
> Please migrate your projects to use @hey-api/openapi-ts
Due to time limitations on my end, this project has been unmaintained for a while now. The @hey-api/openapi-ts
project started as a fork with the goal to resolve the most pressing issues. going forward they are planning to
maintain the OpenAPI generator and give it the love it deserves. Please support them with their work and make
sure to migrate your projects: https://heyapi.dev/openapi-ts/migrating.html#openapi-typescript-codegen
- All open PR's and issues will be archived on the 1st of May 2024
- All versions of this package will be deprecated in NPM
š Thanks for all the support, downloads and love! Cheers Ferdi.
---
[![NPM][npm-image]][npm-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![Build][build-image]][build-url]
> Node.js library that generates Typescript clients based on the OpenAPI specification.
```
npm install openapi-typescript-codegen --save-dev
`
$ openapi --help
Usage: openapi [options]
Options:
-V, --version output the version number
-i, --input
-o, --output
-c, --client
--name
--useOptions Use options instead of arguments
--useUnionTypes Use union types instead of enums
--exportCore
--exportServices
--exportModels
--exportSchemas
--indent
--postfixServices Service name postfix (default: "Service")
--postfixModels Model name postfix
--request
--transformCase
-h, --help display help for command
Examples
$ openapi --input ./spec.json --output ./generated
$ openapi --input ./spec.json --output ./generated --client xhr
``
Documentation
===
The main documentation can be found in the openapi-typescript-codegen/wiki
Sponsors
===
If you or your company use the OpenAPI Typescript Codegen, please consider supporting me. By sponsoring I can free up time to give this project some love! Details can be found here: https://github.com/sponsors/ferdikoomen
If you're from an enterprise looking for a fully managed SDK generation, please consider our sponsor:
[npm-url]: https://npmjs.org/package/openapi-typescript-codegen
[npm-image]: https://img.shields.io/npm/v/openapi-typescript-codegen.svg
[license-url]: LICENSE
[license-image]: http://img.shields.io/npm/l/openapi-typescript-codegen.svg
[coverage-url]: https://codecov.io/gh/ferdikoomen/openapi-typescript-codegen
[coverage-image]: https://img.shields.io/codecov/c/github/ferdikoomen/openapi-typescript-codegen.svg
[downloads-url]: http://npm-stat.com/charts.html?package=openapi-typescript-codegen
[downloads-image]: http://img.shields.io/npm/dm/openapi-typescript-codegen.svg
[build-url]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/main
[build-image]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/main.svg?style=svg