Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find @EnableSwagger annotation

I just wanted to documente my spring rest application. Following the how to with springfox I added as a dependency in my pom.xml:

<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.7.0</version>
</dependency>

the jar is downloaded correctly but I can't find @EnableSwagger2 annotation nowhere.

like image 933
Habchi Avatar asked Jun 12 '17 19:06

Habchi


2 Answers

Same here. springfox.documentation.swagger2 jar doesn't exist in springfox-core:2.7.0 They exist in the previous release of 2.6.1 when I was working with it before. I'm falling back to 2.6.1.

It's probably not a bad idea to check their 2.7.0 release notes to see if there's any bug fix that you need though: https://github.com/springfox/springfox/releases/tag/2.7.0

UPDATE: @EnableSwagger is actually in springfox-swagger2-2.7.0.jar not springfox-core.jar.

like image 154
user779769 Avatar answered Oct 10 '22 01:10

user779769


It shoud be in springfox.documentation.swagger2.annotations package.

like image 29
Bohdan Levchenko Avatar answered Oct 10 '22 00:10

Bohdan Levchenko