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

fix: Respect externally set prefixes #162

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

Hazmi35
Copy link

@Hazmi35 Hazmi35 commented Oct 17, 2024

Fixes #161.

This will also work when you don't specify any prefix to Elysia but uses Traefik Middlewares to strip /api prefix too.

@Hazmi35 Hazmi35 changed the title fix: use requestPath for /json fix: use requestPath for OpenAPI spec in Swagger Options Oct 17, 2024
@Hazmi35 Hazmi35 closed this Oct 19, 2024
@Hazmi35
Copy link
Author

Hazmi35 commented Oct 19, 2024

This doesn't work, swagger ui and scalar should append from the browser URL, not server.

@Hazmi35
Copy link
Author

Hazmi35 commented Oct 19, 2024

Updated. Now this work with externally set prefix (from reverse proxy), but I'm not sure to get the root Elysia app prefix after your change in ebf0e54 where elysia-swagger creates it's own Elysia instance.

@chaseWilliams
Copy link

Just want to bump this, I use supabase functions and have a prefix on the root elysia instance, so my swagger ends up living at /functions/v1/api/swagger/json but the browser tries to query for just /swagger/json, dropping both the prefix and externally set routing components.

@Hazmi35 Hazmi35 changed the title fix: use requestPath for OpenAPI spec in Swagger Options fix: Respect externally set prefixes Oct 20, 2024
@marclave marclave requested review from marclave and SaltyAom November 4, 2024 21:23
@deanrih
Copy link

deanrih commented Dec 19, 2024

Is there any expected merge date for this? I just hit this hurdle when using prefix and using the documentation since our projects are separated by services and it fetches the wrong json url

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

Successfully merging this pull request may close these issues.

OpenAPI spec wrong URL
3 participants