use of py.org.fundacionparaguaya.pspserver.surveys.validation.MultipleSchemaValidator in project FP-PSP-SERVER by FundacionParaguaya.
the class SurveyServiceImpl method validateSchemas.
private ValidationResults validateSchemas(NewSurveyDefinition surveyDefinition) {
ValidationResults results = ValidationSupport.validResults();
MultipleSchemaValidator schemaValidator = all(presentInSchema(), markedAsRequired());
propertyAttributeSupport.getPropertyAttributes().stream().filter(attr -> attr.getStoptLightType() == StopLightType.MANDATORY).forEach(attr -> {
results.addAll(schemaValidator.apply(surveyDefinition.getSurveySchema(), attr.getPropertySchemaName(), null));
});
return results;
}
Aggregations