[ https://issues.apache.org/jira/browse/SLING-4013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Munteanu closed SLING-4013. ---------------------------------- > Allow validator model to refer to non-required properties and child resources > ----------------------------------------------------------------------------- > > Key: SLING-4013 > URL: https://issues.apache.org/jira/browse/SLING-4013 > Project: Sling > Issue Type: Improvement > Components: Validation > Reporter: Konrad Windszus > Assignee: Konrad Windszus > Labels: validation > Fix For: Validation 1.0.0 > > > Currently all properties which are bound to a validator are automatically > mandatory > (https://github.com/apache/sling/blob/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java#L384), > i.e. if the property is not set a validation error will occur. > In some cases the property is not required but if it is there it should be > valid according to the validator. > I propose a new attribute {{optional}} with a boolean value below the > properties resource or child resource of a validation model resource. The > default should be false (i.e. property/child resource is required). > In case of {{nameRegex}} (SLING-4011) the requirement is fulfilled, if at > least one property/child resource name is matching the pattern. -- This message was sent by Atlassian JIRA (v6.4.14#64029)