nitrojs / nitrojs/nitro

OpenAPI, Scalar, and Swagger routes are not found

Open
#3,201 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug v2
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment

I've tried setting custom routes and using the default routes, and I simply cannot find the page that hosts the OpenAPI spec or the swagger or scalar UI. Help?

Reproduction

See here for example: https://stackblitz.com/edit/github-l8fjbbyh

Describe the bug

I believe this is the file that is checking the config and creating the routes: https://github.com/nitrojs/nitro/blob/v2/src/core/config/resolvers/open-api.ts

As far as I can tell, no handler is being created.

Additional context

No response

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/core/config/resolvers/open-api.ts and run the linked StackBlitz reproduction to compare custom and default routes. Trace how the OpenAPI configuration is resolved and whether the spec, Swagger, or Scalar routes are created. Done means the configured or default routes serve the OpenAPI spec and the requested UI.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.