-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Failed to load API definition on URL /v3/api-docs/ (HTTP 404 not found error) #2332
Comments
Please provide a Minimal, Reproducible Example - with HelloController that reproduces the issue. |
I have created a demo project. And of course it works... ;-) However, the response of http://localhost:8080/v3/api-docs/swagger-config looks different in the demo project:
In the project with the issue, the property |
I have added the |
Thank you. |
Now it's public. Sorry for that. |
The group Name cannot be null or empty. |
If you are using config, check if the group name is empty. That is not allowed:
|
I understand but in my case all I did was add the dependency and exclude from the authorization flow this paths: /swagger-ui.html I have not made any extra swagger related config. At this point it should be working :( |
Describe the bug
The swagger-ui frontend tries to load the openapi data from the URL
/v3/api-docs/
with trailing slash.The backend resource
OpenApiWebMvcResource
listens per default on/v3/api-docs
without trailing slash.In fact, the URL
/v3/api-docs/
gets mapped wrongly by Spring:So the frontend displays the error
response status is 404 /my-application/v3/api-docs/
.I am using...
Maybe the issue is caused by this change in Spring:
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/config/annotation/PathMatchConfigurer.html#setUseTrailingSlashMatch(java.lang.Boolean)
The Spring framework is now more precise per default handling URLs. I think the controller that is providing the swagger-config should be adapted. Currently it adds a trailing slash to the 1st url in the urls array:
The text was updated successfully, but these errors were encountered: