<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.1.6</version>
</dependency>
@RestController
@RequestMapping("/api")
public class ApiController {
@ApiImplicitParams({
})
@GetMapping("/users/{userId}")
public ResponseEntity<User> getUserById(@PathVariable Long userId) {
}
@PostMapping("/users")
public ResponseEntity<Void> createUser(@RequestBody User user) {
}
}
yaml
springfox:
swagger2:
enabled: true