Tried a few suggestions in existing stackoverflow discussions but I can't even get the html page to serve, and almost all information on the web uses Spring Boot instead, does anyone have an article, video or a github repo where I can see how the correct configuration is set up? Using embedded jetty to serve if it matters
Tried a few suggestions in existing stackoverflow discussions but I can't even get the html page to serve, and almost all information on the web uses Spring Boot instead, does anyone have an article, video or a github repo where I can see how the correct configuration is set up? Using embedded jetty to serve if it matters
Share Improve this question asked Mar 17 at 12:17 OverdrowsedOverdrowsed 1197 bronze badges1 Answer
Reset to default 0It's possible to take advantage of springdoc-openapi-starter-webmvc-ui
package and however you're bootstrapping the spring app, to just register its usual autoconfig classes manually. Add these to app context: SpringDocConfiguration
, SwaggerConfig
, SpringDocWebMvcConfiguration
, JacksonAutoConfiguration
and these beans somewhere in your configuration:
@Bean
SpringDocConfigProperties springDocConfigProperties() {
return new SpringDocConfigProperties();
}
@Bean
SwaggerUiConfigProperties swaggerUiConfigProperties() {
return new SwaggerUiConfigProperties();
}
@Bean
SwaggerUiOAuthProperties swaggerUiOAuthProperties() {
return new SwaggerUiOAuthProperties();
}
if overriding configureMessageConverters
,
converters.add(new ByteArrayHttpMessageConverter());
is needed