https://github.com/omermecitoglu/next-openapi-interface-generator
OpenAPI interface generator for Next.js
https://github.com/omermecitoglu/next-openapi-interface-generator
cli codegen generator interface next nextjs openapi self-documenting swagger typescript
Last synced: 6 months ago
JSON representation
OpenAPI interface generator for Next.js
- Host: GitHub
- URL: https://github.com/omermecitoglu/next-openapi-interface-generator
- Owner: omermecitoglu
- License: mit
- Created: 2024-03-21T08:11:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-20T13:05:28.000Z (about 1 year ago)
- Last Synced: 2025-07-19T06:51:25.789Z (7 months ago)
- Topics: cli, codegen, generator, interface, next, nextjs, openapi, self-documenting, swagger, typescript
- Language: TypeScript
- Homepage:
- Size: 641 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Next OpenAPI Interface Generator
[](https://www.npmjs.com/package/@omer-x/next-openapi-interface-generator)
[](https://www.npmjs.com/package/@omer-x/next-openapi-interface-generator)
[](https://codecov.io/gh/omermecitoglu/next-openapi-interface-generator)
[](https://opensource.org/licenses/MIT)
[](https://github.com/omermecitoglu/next-openapi-interface-generator/commits/main/)
[](https://github.com/omermecitoglu/next-openapi-interface-generator/issues)
[](https://github.com/omermecitoglu/next-openapi-interface-generator)
This script automates the generation of documentation and TypeScript interfaces for a service, making it easier to maintain and interact with the service in a TypeScript environment.
## Installation
```bash
npm install @omer-x/next-openapi-interface-generator
```
## Usage
```bash
generate-service-interface --output --framework --schemas
```
### Options
- `--output`, `-o`: Specify the output directory. Default: `dist`
- `--framework`, `-f`: (Optional) Specify the target framework. Options: `next`
- `--schemas`, `-s`: (Optional) Specify the path for predefined zod schemas. Multiple paths can be provided, separated by commas.
- `--definer`: (Optional) Name of the function that was exported from the [`Next OpenAPI Route Handler`](https://www.npmjs.com/package/@omer-x/next-openapi-route-handler)
## Example
```bash
generate-service-interface -o dist -f next -s src/models
generate-service-interface -o dist -f next -s src/models/user,src/models/message
generate-service-interface -f next --definer createRoute
```
## Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue if you find any bugs or have any suggestions for improvement.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.