Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Documentation using Openapi #1967

Open
atulraj85 opened this issue Jan 18, 2025 · 1 comment
Open

API Documentation using Openapi #1967

atulraj85 opened this issue Jan 18, 2025 · 1 comment

Comments

@atulraj85
Copy link

I am using zenstack with nextjs 15. I created a zmodel file and added the plugin to generate documentation for API.

plugin openapi { provider = '@zenstackhq/openapi' output = './openapi.yaml' title = 'My awesome API' version = '0.5.0' summary = 'Created with ZenStack' description = 'My awesome API created with ZenStack' prefix = '/api' }

Then I generated the file, it is about 1.4mb. I tried rendering that file to UI it is taking too much of RAM and crashes the site. Then I uploaded that file to online openapi viewer, it crashed that site too.

I am unaware of how to fix / use it. please help.

There are about 15 (mode) tables in my schema.

@ymc9
Copy link
Member

ymc9 commented Jan 24, 2025

Hi @atulraj85 , by default the openapi plugin emits a schema for each type PrismaClient generates. you can use the "omitInputDetails" to reduce the fidelity of the output and get a smaller result:

https://zenstack.dev/docs/reference/plugins/openapi#options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants