How to override the @NotNull HTTP Status Code from 400

Viewed 178

I'm working on creating a new SpringBoot API and I have a few mandatory parameters in my Model. For example

@NotNull(message="Name is Mandatory")
public String Name

Whenever Name is not provided, it currently returns a status code 400 Bad Request with the defined message. Is there a way to override the Status Code from 400 to 404 Not found?

0 Answers
Related