https://github.com/mnahkies/openapi-code-generator
A code generation tool for openapi 3 / 3.1 specifications written in typescript, primarily aimed at generating typescript clients and server stubs. Other target languages may be added in future.
https://github.com/mnahkies/openapi-code-generator
angular axios codegen devtools koa node-fetch openapi openapi-generator openapi-specification openapi3 openapi31 typescript typespec zod
Last synced: 20 days ago
JSON representation
A code generation tool for openapi 3 / 3.1 specifications written in typescript, primarily aimed at generating typescript clients and server stubs. Other target languages may be added in future.
- Host: GitHub
- URL: https://github.com/mnahkies/openapi-code-generator
- Owner: mnahkies
- License: mit
- Created: 2020-07-27T22:27:40.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T19:48:14.000Z (22 days ago)
- Last Synced: 2025-04-09T20:37:53.142Z (22 days ago)
- Topics: angular, axios, codegen, devtools, koa, node-fetch, openapi, openapi-generator, openapi-specification, openapi3, openapi31, typescript, typespec, zod
- Language: JavaScript
- Homepage: https://openapi-code-generator.nahkies.co.nz/
- Size: 28.4 MB
- Stars: 23
- Watchers: 5
- Forks: 2
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# @nahkies/openapi-code-generator
[](https://github.com/mnahkies/openapi-code-generator/actions?query=branch%3Amain+event%3Apush)
[](https://www.npmjs.com/package/@nahkies/openapi-code-generator)`@nahkies/openapi-code-generator` is a CLI tool that aims to generate high quality typescript client SDK's,
and API server scaffolding (routing, validation, serialization) from api specifications.Currently, [OpenAPI 3.0](https://swagger.io/specification/v3), [OpenAPI 3.1](https://swagger.io/specification/),
and [TypeSpec](https://typespec.io/) are supported as input specifications.With typescript templates for [koa](https://openapi-code-generator.nahkies.co.nz/guides/server-templates/typescript-koa), [fetch](https://openapi-code-generator.nahkies.co.nz/guides/client-templates/typescript-fetch), [axios](https://openapi-code-generator.nahkies.co.nz/guides/client-templates/typescript-axios), and [angular](https://openapi-code-generator.nahkies.co.nz/guides/client-templates/typescript-angular) currently available.
The [fetch](https://openapi-code-generator.nahkies.co.nz/guides/client-templates/typescript-fetch) and [axios](https://openapi-code-generator.nahkies.co.nz/guides/client-templates/typescript-axios) templates work great in conjunction with [react-query](https://tanstack.com/query/latest)
> [!TIP]
> Try out our [interactive playground here](https://openapi-code-generator.nahkies.co.nz/playground)- [Documentation](#documentation)
- [Project Structure](#project-structure)
- [Contributing](#contributing)
- [License](#license)## Documentation
Visit https://openapi-code-generator.nahkies.co.nz/ for detailed documentation including
quick start guides and reference material.The documentation is built using NextJS / Nextra, and deployed using Github pages.
You can contribute to it in [./packages/documentation](./packages/documentation)## Project Structure
The repository is structured as a mono repo of several npm packages that work together under [./packages](./packages):
- [openapi-code-generator](./packages/openapi-code-generator)
- [typescript-axios-runtime](./packages/typescript-axios-runtime)
- [typescript-fetch-runtime](./packages/typescript-fetch-runtime)
- [typescript-koa-runtime](./packages/typescript-koa-runtime)The `openapi-code-generator` package is the main package, whilst the others are supporting packages used at runtime by
the code output by some of the templates.Integration test definitions live in [./integration-tests-definitions](./integration-tests-definitions) and the generated
code output to [./integration-tests](./integration-tests)Scripts to refresh the test data live in [./scripts](./scripts)
## Contributing
Contributing guidelines can be found in [./CONTRIBUTING.md](./CONTRIBUTING.md).
## License
MIT Licensed, see [./LICENSE](./LICENSE)