mjson
mjson copied to clipboard
Implement validating annotations
This should be in a related to mJson project (e.g. mJsonPlus that could contains all extra goodies while keeping mJson itself small). The idea is to create Java annotations that validate input and output of Json methods:
@JsonValidate("/resources/schemas/person.json") public void doSomethingWithPerson(Json person) { ....// here we know the person arguments is a valid person }
such validating annotations would be placed only at entry points...of course, to avoid validating every single time something as passed as an argument. Alternatively, we might have some meta information kept in a global map that says that such and such objects has been validated and follows a schema.