Iam trying to get swagger to work besides my Vaadin-Flow Application.
Iam currently using Vaadin 22.0.4 with Spring-Boot 2.6.3 and springdoc-openapi-ui 1.6.5.
The Swagger-ui should be available under http://localhost:8080/swagger-ui, but it is not:

I guess it gets blocked by vaadin in some way.
Things like http://localhost:8080/v3/api-docs or Rest-Endpoints created by spring work fine.
Is there a way to allow a specific routes for swagger to work?
What i tried so far:
WebSecurityConfigurerAdapter and overriting configure). There is a example of one try in the repository linked below.vaadin.urlMapping=/foo/* in the application.properties to change the root mapping from vaadin. That kinda works... Swagger is available under http://localhost:8080/swagger-ui and the Vaadin UI under http://localhost:8080/foo. I am just looking for the other way around. Vaadin should be available under http://localhost:8080/. But that shows that swagger would work.I also Uploaded a plain Vaadin project where the issue is reproducible: https://github.com/DerAzubi/swagger-test (to test the application just start the main function)
the last commit contains all changes made to the default vaadin starter.
This is fixed in Vaadin 23.3.0 but not in a fully automatic way. You can define paths to exclude, e.g. vaadin.excludeUrls=/swagger-ui/** and those will not be handled by the Vaadin servlet when it is mapped to /*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With