I'd like to use Swagger to provide an API-Documentation for my Spring Boot API. I managed to get Springfox 2.3.0 to work and everything works as expected except for the controllers returning an ObjectNode. Swagger tries 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 can't guess which values are contained in the JSON I build, but I'd 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 any way I can provide a custom ResponseJSON to Swagger which is shown in the documentation as Model Schema?