I am writing a REST API with a Java / Jersey / Jackson stack. All JSON parsing and generation is done using Jackson. REST level handled by jersey. It will be built into the Grizzly container.
In my API, I accept JSON at my endpoints. For instance:
@POST
public Response post(final SomeObject input) {
return ...;
}
What is the best way to check input? There are some things that I would like to confirm:
input must not be null- certain fields
inputmust not be empty - certain fields
inputmust follow regular expression (text fields) - certain fields
inputmust be in a range (numeric fields) - ...
, . , , .