Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/danielgek/openapi-ts

OpenApi/Swagger to Typescript defenitions!
https://github.com/danielgek/openapi-ts

openapi swagger typescript

Last synced: 23 days ago
JSON representation

OpenApi/Swagger to Typescript defenitions!

Awesome Lists containing this project

README

        

# OpenApi/Swagger to TypeScript definitions!

This tool generates TypeScript interfaces/Enums to all entities that you specified on swagger/openapi spec.

**Note:** this generates **only** interfaces and Enums

## Installation

```
npm install --save-dev openapi-ts
```

## Generating types (CLI)

```bash
npx openapi-ts -i ./src/api-docs.json -o ./gen.d.ts
```

## Generating types (javascript module)

```javascript
const { generate } = require('openapi-ts');

generate(openAPISpecPath, outputPath);
```