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

A quick start option without a Route Handler, based on JSDoc? #1

Open
dmythro opened this issue Jun 20, 2024 · 3 comments
Open

A quick start option without a Route Handler, based on JSDoc? #1

dmythro opened this issue Jun 20, 2024 · 3 comments

Comments

@dmythro
Copy link

dmythro commented Jun 20, 2024

Hi. Found this, looks cool.

But for starters (and existing project with a lot of routes) it would be great to generate a spec simply based on standard Next.js route.ts handlers and JSDoc. It would be really cool.

I checked Route Handler as well, looks pretty useful. But migration would take a lot of time and I need a quicker solution for now over my plain Next.js app codepase to at least list all API endpoints (and use some data from JSDoc if possible).

Does it make sense?

@omermecitoglu
Copy link
Owner

Yea, I hear you. You've got a point. When I was migrating for myself, I've done that manually and it was a real pain. I think I can make a route generator from a swagger.json but not JSdoc. I'm really done with JSdoc after that migration.

@gvzq
Copy link

gvzq commented Jul 5, 2024

@dmythro take a look at https://github.com/jellydn/next-swagger-doc. It might be closer to what you're looking for. Note that you will need to use @openapi tags to add the endpoint spec in a way that looks like a open api yaml file.

@dmythro
Copy link
Author

dmythro commented Jul 9, 2024

@dmythro take a look at https://github.com/jellydn/next-swagger-doc. It might be closer to what you're looking for. Note that you will need to use @openapi tags to add the endpoint spec in a way that looks like a open api yaml file.

Thanks! I did check that before and not really a solution I'd look at. Mainly, it doesn't really utilise app routing and you have to specify routes manually for each request handler. Plus, this @swagger thing is required. And for existing project with a lot of APIs is exhausting to migrate to.

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

3 participants