Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Sling Models Implementation 1.0.4
Description
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 .
Attachments
Issue Links
- Is contained by
-
SLING-3696 Allow a model class to be annotated so that by default injections are optional
- Closed