0

We are facing one issue in loading swagger ui. Out project is built on spring web flux and integrated with springdoc-openapi-webflux-ui. Whenever we try to load the swagger url, spring web flux returns partial js and css response(swagger-ui.css, swagger-ui-bundle.js).

Please let us know what should be the reason for this partial response from spring web flux

user2390827
  • 115
  • 2
  • 7
  • 15

1 Answers1

0

Which version of swagger are you using?

You also might check this doc: https://github.com/springfox/springfox#migrating-from-earlier-snapshot

For me, it worked with the following code

@Configuration
@EnableWebFlux
public class SwaggerConfig implements WebFluxConfigurer {
    @Bean
    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2)
                .genericModelSubstitutes( Mono.class, Flux.class, Publisher.class)
                .select()
                .paths( PathSelectors.any())
            .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
                .build();
    }
}