I'm writing code for validation of json request for user creation method. Validator have to check whether the email field is equal to field confirmEmail. Request example:
{
"firstName":"Homer",
"lastName":"Simpson",
"email":"test1234@fox.com",
"confirmEmail":"test1234@fox.com",
...
}
I'm using the tv4 schema validation lib. The goal is to write a schema to validate equality between email and confirmEmail fields.
Of course I can check the those fields in request directly but I'd use it as last resort in case schema validation will not work.