Open SelfhostedPro opened 5 months ago
Came across the same issue, stable channel of nitro is currently using swagger-ui-dist
v4 CDN, which doesn't support OpenAPI 3.1.0 which is what it is set to.
Switching to nightly channel should fix your problem.
Ah, I thought I also ran into this on nightly. Is there a way to manually specify the OpenAPI version in the nuxt config?
Sadly it isn't possible since the value is hardcoded. https://github.com/unjs/nitro/blob/3a69dd70bae87d12a6d9a86691fad48b2ebb044e/src/runtime/routes/openapi.ts#L25-L28 Though you could propose to use the upcoming meta object (https://github.com/unjs/nitro/pull/2299) to allow setting OpenAPI's version and use the latest if it isn't set, but I don't really see much purpose in that, would require more discussion.
What I did as a temporary workaround: I copied the generated routes from /_nitro/openapi.json
and imported them into Postman. Do note that you will need to change the info version that is currently set to null
, which is a invalid schema if you're going to use this approach.
Hi, I expect this issue will be resolved when the version containing this Pull Request is released. https://github.com/unjs/nitro/pull/2343
You can try with https://nitro.unjs.io/guide/nightly
Environment
latest everything (node latest LTS)
Reproduction
https://stackblitz.com/edit/github-ujxcqv?file=nitro.config.ts
Describe the bug
Swagger docs aren't visible when going to /_nitro/swagger and pops up the following error:
Additional context
No response
Logs
No response