I have a route like:
@PostMapping("/")
public void sendNotification(@RequestBody PostBody postBody){...}
And the fields in PostBody class are:
public class PostBody {
private String type;
private String payload;
private String recipients;
private String callerId;
I am wondering, can I make one or more of these fields optional, but not all of them?
I guess if I use (require = false), all fields will be optional, is that right?
Then is there anyway to do that?
Thanks!