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

swagger API #4

Closed
pi0 opened this issue Feb 9, 2022 · 8 comments · Fixed by #1162
Closed

swagger API #4

pi0 opened this issue Feb 9, 2022 · 8 comments · Fixed by #1162
Assignees
Labels
enhancement New feature or request

Comments

@pi0
Copy link
Member

pi0 commented Feb 9, 2022

expose swagger compatible API from dev server based on handler defenitions.

@pi0 pi0 added the enhancement New feature or request label Apr 6, 2022
@pi0
Copy link
Member Author

pi0 commented Apr 6, 2022

Not a periority (reopened following up #170)

Related:

@pi0 pi0 closed this as completed Apr 6, 2022
@pi0 pi0 reopened this May 2, 2022
@BracketJohn
Copy link

Quoting from https://github.com/nuxt/framework/discussions/4582:

[..] swagger UI is a great feature for newcomers, product managers and smoke-testing (:

So would really love to see this - with the correct pointers I'd even try myself on it, but am unsure if this is a good first issue.

@pi0 pi0 mentioned this issue Jun 22, 2022
8 tasks
@septatrix
Copy link
Contributor

septatrix commented Oct 25, 2022

Is the whole /server/api of Nuxt 3 mostly handled by nuxt or nitro? ...if nitro only has access to the routes and url arguments but not the return type or similar it would make little sense to implement it inside nitro.

Or generally: Is there any access to the route definitions and types during runtime in either nitro or nuxt? I would think so as nuxt generates .d.ts file on the fly based on my understanding so far but I might be wrong. If that is the case than that could be used to generate them and potentially expose them on a special endpoint, kinda like FastAPI does.

@sannajammeh
Copy link

Is there any more work being done on this? Could it be possible to export a json schema or zod type to reflect what the endpoint is returning in the OpenAPI spec?

@pi0
Copy link
Member Author

pi0 commented Nov 2, 2023

Currently it is exposed via experimental flag as /_nitro/openapi.json. So you can use it already.

It is in our roadmap after introducing route meta support to improve this feature and iterate.

@MrlolDev
Copy link

MrlolDev commented Jan 6, 2024

how can you modify the tags?

@chenyuncai
Copy link

is there any way to support nested route. Api need to be grouped in most case.

@pi0
Copy link
Member Author

pi0 commented Mar 8, 2024

@chenyuncai feel free to open new individual issue for it 👍🏼 (or any other idea related to openapi)

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

Successfully merging a pull request may close this issue.

6 participants