I would like to use Swagger to provide API documentation for my Spring boot API. I managed to get Springfox 2.3.0 to work, and everything works as expected, with the exception of controllers that return ObjectNode. Swagger is trying to convert the returned class (ObjectNode) to a JSON representation, and the result is this:
{ "array": true, "bigDecimal": true, "bigInteger": true, "binary": true, "boolean": true, "containerNode": true, "double": true, "float": true, "floatingPointNumber": true, "int": true, "integralNumber": true, "long": true, "missingNode": true, "nodeType": "ARRAY", "null": true, "number": true, "object": true, "pojo": true, "short": true, "textual": true, "valueNode": true }
Now I know that Swagger cannot guess what values ββare contained in the JSON I build, but I would like to manually add the correct ResponseModel in any form.
The Controller looks something like this: @ApiOperation(value = "NAME", notes="NOTES") @RequestMapping(value = "", method = RequestMethod.GET, produces="application/json") public ResponseEntity<ObjectNode> getComponentByIdentification(@ApiParam(name="customerid", required=true, value="") @RequestParam (required = true) String customerId) return new ResponseEntity<ObjectNode>(someService.getCustomer(customerId), HttpStatus.OK); }
Is there a way to provide a custom ResponseJSON for Swagger, which is shown in the documentation as a model outline?