In Springfox I once used the following syntax to render a String parameter with a full model (original Github issue):
@PatchMapping(path="/{objId}")
@ApiImplicitParams(@ApiImplicitParam(name="update", dataType="MyClass"))
public ApiResponse<MyClass> updateMyClassInst(@PathVariable String objId, @RequestBody String update) {
The reason for this formulation is that if I put MyClass
as type for the request body I had no way to distinguish when a property has not been updated or when has been set to null, because both would be deserialized to a null field value.
How do I do that with Springdoc?