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

Unexpected warning "Appended trailing slash to static resource location" #2947

Closed
gwimmel opened this issue Mar 24, 2025 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@gwimmel
Copy link

gwimmel commented Mar 24, 2025

Describe the bug

In a Spring Boot 3.4.4 application with springdoc-openapi 2.8.4 I get the following unexpected warning message in the log when starting the application:

WARN o.s.w.r.resource.ResourceHandlerUtils    : Appended trailing slash to static resource location: classpath:/META-INF/resources/webjars/swagger-ui/5.18.2/

To Reproduce
Steps to reproduce the behavior:

  • create a Spring Boot app with spring-webflux
  • add springdoc-openapi 2.8.4 to the dependencies
  • create a minimal RestController with a hello world @GetMapping- Method
  • run the application

Expected behavior

  • no warning message 'Appended trailing slash' in the log

Additional context

  • 2.8.4 is the first springdoc-openapi version in which the warning message appears.
  • The warning message also appears in the current springdoc-openapi version 2.8.6
  • This is also mentioned in #2878 , but this bug was closed, probably because it mainly refers to the path handling change introduced by #2862 which appears to be intended. Most probably the warning is also related to #2862 .
  • I could provide a minimal example if it was helpful for analysis.
@bnasslahsen
Copy link
Collaborator

Image

Not reproducible, with your current descrption.
Feel free to provide a Minimal, Reproducible Example - with HelloController that reproduces the problem.

This ticket will be closed, but can be reopened if your provide the reproducible sample.

@bnasslahsen bnasslahsen added the invalid This doesn't seem right label Mar 24, 2025
@gwimmel
Copy link
Author

gwimmel commented Mar 25, 2025

@bnasslahsen Thanks for checking. Strange. Did you use spring-webflux?

Here's a minimal example: https://github.com/gwimmel/springdoc-trailingslash-warning

When I run it using mvn spring-boot:run, I get the warning in the log:

Image

@bnasslahsen bnasslahsen reopened this Mar 25, 2025
@bnasslahsen bnasslahsen added bug Something isn't working and removed invalid This doesn't seem right labels Mar 25, 2025
@bnasslahsen
Copy link
Collaborator

@gwimmel,

Now reproduced!
You validate with the latest SNAPSHOT, if it resolves your issue.

@gwimmel
Copy link
Author

gwimmel commented Mar 25, 2025

@bnasslahsen thanks for the quick fix! I can confirm that the warning message is not logged anymore with springdoc-openapi 2.8.7-SNAPSHOT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants