Próbuje uruchomić SwaggerUI w projekcie, jednak z jakiegoś powodu nie działa on gdy mam jednocześnie konfigurację WebSocketów.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
@Configuration
public class SwaggerConfiguration {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.example.app.web.rest"))
.paths(PathSelectors.any())
.build();
}
}
Coś takiego działa.
Ale jak odkomentuje @EnableWebSocketMessageBroker
w
@Configuration
//@EnableWebSocketMessageBroker
public class WebSocketConfiguration implements WebSocketMessageBrokerConfigurer {
To po wejściu na http://localhost:8080/swagger-ui/index.html#/ dostaje HTTP 404 a w logach
2020-11-08 10:08:11.859 WARN 17772 --- [nio-8080-exec-1] o.s.w.s.s.t.h.DefaultSockJsService : Invalid SockJS path '/swagger-ui/index.html' - required to have 3 path segments
Nawet znalazłem podobne pytanie na stacku... https://stackoverflow.com/questions/59192507/spring-boot-swagger-jwt-websocket-failing-to-open-swagger-ui-html-once-w
Niestety bez odpowiedzi. Może ktoś z Was miał podobny problem?