https://github.com/influxdata/oats
An OpenAPI to TypeScript generator.
https://github.com/influxdata/oats
Last synced: 8 months ago
JSON representation
An OpenAPI to TypeScript generator.
- Host: GitHub
- URL: https://github.com/influxdata/oats
- Owner: influxdata
- License: mit
- Created: 2019-04-01T20:55:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T21:00:01.000Z (about 2 years ago)
- Last Synced: 2025-04-11T01:41:21.768Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 834 KB
- Stars: 13
- Watchers: 8
- Forks: 6
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
An opinionated OpenAPI doc to TypeScript HTTP client generator.
In comparison to [openapi-generator](https://github.com/OpenAPITools/openapi-generator):
- Strives to generate readable output
- Supports enums, `oneOf`, and `allOf`
- Does not require Java runtime
- Generates `fetch`-based HTTP client with typed error responses
- Does not support significant portions of the OpenAPI spec
## Installation
```
yarn add -D @influxdata/oats
```
## Usage
```
$ yarn run oats --help
```
```
Usage: oats [options]
An opinionated OpenAPI doc to TypeScript HTTP client generator
Options:
-V, --version output the version number
-i, --include comma sepated list of code parts to generate (all by default: "types,request,operations")
-p, --prettier [true/false] prettier output code (default: true)
--withDoc [true/false] document generated types (default: true)
--patchScript apply script that modifies openapi document (example: https://github.com/influxdata/influxdb-client-js/blob/master/packages/apis/scripts/patchSwagger.js)
--storeOperations store operations to file
-h, --help output usage information
```
## Contributing
See [`CONTRIBUTING.md`](./CONTRIBUTING.md).