Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Workaround for /swagger not working #8

Open
utybo opened this issue Jun 29, 2022 · 0 comments
Open

Workaround for /swagger not working #8

utybo opened this issue Jun 29, 2022 · 0 comments

Comments

@utybo
Copy link
Owner

utybo commented Jun 29, 2022

Because Swagger UI uses relative links to resolve resources (like CSS, JS and images), going to /swagger will serve the correct index.html file, but the browser will call the wrong URLs when trying to resolve resources. A simple workaround is to trigger a 307 redirection from /swagger to /swagger/index.html if possible.

There is a potential trap here because I don't think Ktor has an easy way of specifying "redirect to this subroute", and we can only set a redirection to an absolute path.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant