Not entirely sure if this belongs here or on the actual swagger-springmvc project; tried to follow the given steps to get Swagger working with SpringMVC in a no XML environment: servlet 3, @configuration everywhere. Ended up doing the following:
- Add a
PropertyPlaceholderConfigurer to the existing Spring configuration class:
@Bean
public static PropertyPlaceholderConfigurer swaggerProperties() {
final PropertyPlaceholderConfigurer swaggerProperties = new PropertyPlaceholderConfigurer();
swaggerProperties.setLocation(new ClassPathResource("swagger.properties"));
return swaggerProperties;
}
- Modify the
WebApplicationInitializer to load the DocumentationConfig:
// Create the 'root' Spring application context
AnnotationConfigWebApplicationContext ctx = new AnnotationConfigWebApplicationContext();
ctx.register(SpringBaseConfiguration.class, SpringWebConfiguration.class, DocumentationConfig.class);
I didn't have to create any other beans or instantiate any other objects.
Not entirely sure if this belongs here or on the actual swagger-springmvc project; tried to follow the given steps to get Swagger working with SpringMVC in a no XML environment: servlet 3, @configuration everywhere. Ended up doing the following:
PropertyPlaceholderConfigurerto the existing Spring configuration class:WebApplicationInitializerto load theDocumentationConfig:I didn't have to create any other beans or instantiate any other objects.