[
https://issues.apache.org/jira/browse/ISIS-256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446889#comment-13446889
]
Barry Woods commented on ISIS-256:
----------------------------------
Resolution:
1. Added a check for optional facet. If field is mandatory and not supplied now
throws and IllegalArgumentException
2. Flags the the error field with an invalidReason of consent.getReason() and
continues processing remaining fields
Did consider just silently ignoring any value supplied but decided this was a
more complete approach. Downside is that any getter only fields will need to be
annotated @Optional before the object can be persisted.
> NullPointerReference exceptions when attempting to persist an object
> --------------------------------------------------------------------
>
> Key: ISIS-256
> URL: https://issues.apache.org/jira/browse/ISIS-256
> Project: Isis
> Issue Type: Bug
> Components: Viewer: RestfulObjects
> Affects Versions: 0.2.0-incubating, 0.3.1-incubating
> Reporter: Barry Woods
> Labels: patch
> Fix For: 0.3.1-incubating
>
> Attachments: DomainResourceHelper.java
>
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> NullPointerReference exceptions when attempting to persist an object. This
> occurs under two scenarios:
> 1. Omitting the json for a field annotated as @Optional in the pojo
> 2. Attempting to persist an object that has getter only fields
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira