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
Explicit Mapping for swagger-ui.html #2078
Comments
In your case you should simply point to |
How do I have swagger ignore the servercontext? This would also not work, as the same base URL is used to map to different APIs for my purpose. |
I see... can't say without looking at the code. But the springfox-demo does exactly that. It creates a context path |
So in that example project you have server.contextPath=/springfox. In my project, I'm doing something very similar where my server.contextPath=/serverContext |
I found a way to solve the issue by making the path parameter more explicit so that it wouldn't try to include swagger-ui.html |
@gborges0727 Would you mind sharing your way, just so it might help someone else with the same problem you had? |
Sure. So I know for my {parameter} I expect a number. I simply defined that path mapping explicitly with a regex to expect a number, by doing: |
I have a small issue. On my project, I have a route that expects a parameter in the path
Example: localhost.com/serverContext/{parameter}
This presents an issue when trying to access swagger-ui, as when I try to hit the swagger-ui URL, locahost.com/serverContext/swagger-ui.html, spring complains, saying it does not match the {parameter} specification. Is there a way to explicitly define a mapping for swagger-ui.html, so that spring knows when I put it in the URL to hit the page and not treat it as me putting the value in as a parameter?
I've tried changing the mapping to swagger-ui (i.e. putting it behind /documentation), as described in issue 1080, (#1080), however this presents a new issue with the serverContext being mapped to a different path, so I'm trying to avoid any complexities there.
Any help is appreciated. Thanks!
The text was updated successfully, but these errors were encountered: