Krystian Panek created SLING-3679:
-------------------------------------

             Summary: Required fields validation
                 Key: SLING-3679
                 URL: https://issues.apache.org/jira/browse/SLING-3679
             Project: Sling
          Issue Type: Improvement
          Components: Extensions
    Affects Versions: Sling Models Implementation 1.0.4
            Reporter: Krystian Panek
             Fix For: Sling Models Implementation 1.0.6


Currently if some field cannot be injected (and it is not annotated with 
@Optional), model adapter factory returns null. However fact that some field 
has null and all other are properly injected is acceptable in my context.

Proposal:
* model adapter factory does not return null if not all required fields are 
injected,
* result of requirement validation is serviced as for example:
** injecting it to some extra annotated field: @Valid boolean valid; (with 
default false),
** passing bool parameter in @PostConstruct callback, for example 'valid' (true 
if all required field are injected, false otherwise),
* behave current behavior, new available only with extra model class 
annotation, for example @NotNull .






--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to