We have a service that simply returns the json document on a GET request. Since we do not have the POJO for the response "model", it appears we won't be able to use the auto response fields generation "goodness".
One option for us is to create the Pojos (quite large, about 50 attributes) and a corresponding controller that uses the pojos. This is awkward as we now have to maintain the model and corresponding controller just so we can auto generate the model.
Any ideas on how we can still leverage some auto generation of the response fields would be greatly appreciated.
Here's the controller I'm referring to:
@RestController
@RequestMapping("/api")
public class ProductController {
@Autowired
ProductService productService;
@RequestMapping(value = { "/products/{ids}" }, method = { RequestMethod.GET },
produces = "application/json", headers={"accept=application/json"})
@Timed
@ExceptionMetered
@LogExecutionTime
public String getProductDetails(@PathVariable("id") String id) {
return productService.getProductDetails(id);
}