Library that generates Typescript clients based on the OpenAPI specification.
npm install @yrefaeli/openapi-typescript-codegen[![NPM][npm-image]][npm-url]
[![License][license-image]][license-url]
[![Coverage][coverage-image]][coverage-url]
[![Quality][quality-image]][quality-url]
[![Code Climate][climate-image]][climate-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
--postfix
--request
-h, --help display help for command
Examples
$ openapi --input ./spec.json --output ./generated
$ openapi --input ./spec.json --output ./generated --client xhr
`
Documentation
===
- Basic usage
- OpenAPI object
- Client instances --name--useOptions
- Argument vs. Object style --useUnionTypes
- Enums vs. Union types --exportSchemas`
- Runtime schemas
- Enum with custom names and descriptions
- Nullable props (OpenAPI v2)
- Authorization
- External references
Support
===
- Babel support
- Axios support
- Angular support
- Node-Fetch support
[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
[quality-url]: https://lgtm.com/projects/g/ferdikoomen/openapi-typescript-codegen
[quality-image]: https://img.shields.io/lgtm/grade/javascript/g/ferdikoomen/openapi-typescript-codegen.svg
[climate-url]: https://codeclimate.com/github/ferdikoomen/openapi-typescript-codegen
[climate-image]: https://img.shields.io/codeclimate/maintainability/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/master
[build-image]: https://circleci.com/gh/ferdikoomen/openapi-typescript-codegen/tree/master.svg?style=svg