for @RequestParam
there is the option to declare the variable as Optional<T>
to find out if the parameter was set at all. Is there something similar for @RequestBody
members?
For example take the following class used as a @RequestBody
parameter in a patch endpoint. Is it possible to differentiate between a null name and no name at all? I'd like to only set the name to null, if the client explicitly sets the name to null (rather than leaving out the name).
public class UserPatchRequestBody {
public String name
}