springdoc / springdoc.github.io

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
9 stars 40 forks source link

Removing webjars-locator-core broke using a provided spec. #58

Closed madorb closed 1 year ago

madorb commented 1 year ago

Describe the bug

It appears that attempting to use a provided spec as documented here is broken since webjars-locator-core was removed in springdoc/springdoc-openapi#2173

setting springdoc.api-docs.enabled=false disables autoconfiguration which results in the new SpringDocsUIConfiguration not being configured - which causes a 404 when attempting to resolve the webjar.

I believe the instructions likely need updated to include defining a bean like:

@Bean
SpringDocsUIConfiguration springDocsUiConfiguration(Optional<SwaggerUiConfigProperties> optionalSwaggerUiConfigProperties){
    return new SpringDocsUIConfiguration(optionalSwaggerUiConfigProperties);
}

To Reproduce

Expected behavior

swagger-ui loads