swagger.json generate only with tags section
See original GitHub issueHi, I get build success, but a very partial json swagger is create. Namely it look like my @ApiOperation annotation is completely missed or ignored. When I compile I see the following print:
— swagger-maven-plugin:3.1.4:generate (default) @ backend — [INFO] Reflections took 126 ms to scan 1 urls, producing 9 keys and 12 values [INFO] Reflections took 5 ms to scan 1 urls, producing 9 keys and 12 values [INFO] Reflections took 5 ms to scan 1 urls, producing 9 keys and 12 values [INFO] Reflections took 5 ms to scan 1 urls, producing 9 keys and 12 values
Using <plugin> <groupId>com.github.kongchen</groupId> <artifactId>swagger-maven-plugin</artifactId> <version>3.1.4</version>
Swagger annotations, swagger core and springfox
<dependency> <groupId>io.swagger</groupId> <artifactId>swagger-annotations</artifactId> <version>1.5.6</version> </dependency> <dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-core</artifactId>
<scope>compile</scope>
<version>1.5.6</version>
<exclusions>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
And My code: ` @Api(tags = “Greetings”, description = “Greeting Resource”) @RestController @RequestMapping(value = “api/greetings” , produces = “application/json”) public interface GreetingsController {
@ApiOperation(value = "Get your greeting here", response = GreetingResource.class)
@RequestMapping(value = "" , method = RequestMethod.GET)
GreetingResource getGreetings();
} `
when I run my app and check /api-docs - I see the correct full json.
Please help
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (2 by maintainers)
Top GitHub Comments
Since it looks like you are using Jax/RS, try instead of @RequestMapping(value = “/”)
@RequestMapping(path = “/”)
Thanks, that helps