Generate the API client for Fetch or Axios from an OpenAPI Specification
npm install swagger-typescript-api- Support for OpenAPI 3.0, 2.0, JSON and YAML
- Generate the API Client for Fetch or Axios from an OpenAPI Specification
Any questions you can ask here:
All examples you can find here:
You can use this package in two ways:
``bash`
npx swagger-typescript-api generate --path ./swagger.json
Or install locally in your project:
`bash`
npm install --save-dev swagger-typescript-api
npx swagger-typescript-api generate --path ./swagger.json
`bash`
npm install --save-dev swagger-typescript-api
`typescript
import * as path from "node:path";
import * as process from "node:process";
import { generateApi } from "swagger-typescript-api";
await generateApi({ input: path.resolve(process.cwd(), "./swagger.json") });
``
For more detailed configuration options, please consult the documentation.
- 5 Lessons learned about swagger-typescript-api
- Why Swagger schemes are needed in frontend development ?
- Migration en douceur vers TypeScript (French)
- swagger-typescript-api usage (Japanese)
Licensed under the MIT License.