final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("staff");
final JsonElement element = this.fromApiJsonHelper.parse(json);
if (this.fromApiJsonHelper.parameterExists("officeId", element)) {
final Long officeId = this.fromApiJsonHelper.extractLongNamed("officeId", element);
baseDataValidator.reset().parameter("officeId").value(officeId).notNull().integerGreaterThanZero();
}
if (this.fromApiJsonHelper.parameterExists("firstname", element)) {
final String firstname = this.fromApiJsonHelper.extractStringNamed("firstname", element);
baseDataValidator.reset().parameter("firstname").value(firstname).notBlank().notExceedingLengthOf(50);