Last active
April 4, 2017 17:05
-
-
Save indrabasak/7dab321b590cea64d89be7a274838733 to your computer and use it in GitHub Desktop.
SWAGGER2_INTEGRATION_WITH_SPRING_REST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
@Api(value = "customers") | |
public class CustomerServiceController { | |
... | |
@ApiOperation(value = "Gets a customer based on customer id", | |
notes = "Retrieves a single customer", response = Customer.class) | |
@RequestMapping(method = RequestMethod.GET, | |
produces = { MediaType.APPLICATION_XML_VALUE, | |
MediaType.APPLICATION_JSON_VALUE }, | |
value = "customers/{id}") | |
@ResponseBody | |
public Customer getCustomer(@PathVariable Integer id) { | |
Customer customer = service.getCustomer(id); | |
return customer; | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment