Forum Discussion
vicnetto
3 years agoNew Contributor
Just found the answer for my problem. Actually, at the beginning, I forgot to mention that my project was a multimodule spring project. I didn't thought this would change anything on the problem, but I was wrong. The problem was that my SpringApplication wasn't scanning the class SwaggerConfiguration.
If you're having any problem like that, you should insert this annotations into your SpringBootApplication:
@SpringBootApplication(scanBasePackages = "br.com.vicnetto")
@EnableSwagger2
public class SpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(ConsoleConfigApplication.class, args);
}
}
The argument scanBasePackages of the @SpringBootApplication should include the SwaggerConfiguration class.
And the second annotation @EnableSwagger2 needs to be in the @SpringBootApplication context (only for Swagger version under 3.0.0).
Related Content
- 9 months agoroopepaajanen
- 3 months agoyos123
- 2 years agojerry91
- 5 years agoforX