-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Feature/philip/auto doc generation #812
base: main
Are you sure you want to change the base?
Feature/philip/auto doc generation #812
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
Hi @PhilipWee Is this ready to review?
Regards this point, I don't think a lot of people really using nextjs 13 on production. It would be good if we could support page route along with app route. What do you think? |
@jellydn Okay I'll think about how to make the pages router work, shouldn't be too hard Its not ready for review, I just wanted your thoughts on the implementation Specifically the following: The following is a general idea of how the proof of concept works, I'll fix the edge cases if the general direction is okay From the api paths, glob the relevant App router files |
Hi @PhilipWee Your approach should work. Just a few comments on how we should build the library.
Zod doesn't support tree-shaking well. Have you ever tried valibot? Good reference if you want to take a look https://www.builder.io/blog/valibot-bundle-size
It would be good if we have an option for user choose the what is the output they want. [Supported specifications](https://github.com/Surnet/swagger-jsdoc#supported-specifications)
OpenAPI 3.x
Swagger 2
AsyncAPI 2.0 |
WHAT
An incredibly crude proof of concept for automatically generating the responses and paths automatically rather than having users manually update it
#809
WHY
To keep code DRY
HOW
The following is a general idea of how the proof of concept works, I'll fix the edge cases if the general direction is okay
LIMITATIONS
I'll only make it work for App router for now, if people request for Pages router, I'll do that but my spider senses tell me there's alot of edge cases for that.
Also I'm only going to make it work for routes defined in a very specific format first, (The export const GET = blabla format) because I'm too lazy to handle edge cases - We can do it the prettier way and blame everything on the end user and say that its our way or the highway
STEPS
I have done none of these lmao, will do after proof of concept gets go ahead