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

Dot in pathname #145

Open
Fjandin opened this issue Sep 3, 2024 · 1 comment
Open

Dot in pathname #145

Fjandin opened this issue Sep 3, 2024 · 1 comment

Comments

@Fjandin
Copy link

Fjandin commented Sep 3, 2024

When using dots in pathname the routes don't get included in the generated swagger. Is there any specific reason for this?

Example

import swagger from "@elysiajs/swagger"
import Elysia from "elysia"

const app = new Elysia()
  .use(swagger())
  .get("/test", () => "Hello World")
  .get("/test.2", () => "Hello World 2")
  .group("/v1.2", (app) => app.get("/test", () => ({ status: "ok" })))
  .listen(3001)

Routes with dot in the path are not included
CleanShot 2024-09-03 at 12 39 33

EDIT

So it seems like if i set excludeStaticFile: false, it does indeed include my paths with dots since the filterPaths in utils considers any path with a dot as a static file.

@mtt-artis
Copy link

Hey 👋

Here is the incriminate line
https://github.com/elysiajs/elysia-swagger/blob/main/src%2Futils.ts#L333

Don't really know if there is a better way to detect static files? Check only in the last route param ?

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

2 participants