@RestController
@RequestMapping("/appresource")
@Api(value = "AppResource", description = "Operations pertaining
AppResources")
public class AppResource {
...... ......
//Below api is added with produces for application/json
@RequestMapping(value = "/getappversion", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
但是API仍会间歇性地返回XML格式的响应。