[
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14978572#comment-14978572
]
Christian Amend commented on OLINGO-793:
----------------------------------------
Hi Ramesh,
if I understand your question correctly then your expected behaviour would be
that data which does not conform with the facets will still result in a string
with the precision cut off. So for example my data contains a date (format
hh.mm.ss.msms) 12.12.12.42 the resulting string would be "12.12.12" since the
default is 0 precision. There would be no exception involved.
This is a behaviour I do not think is good as we would change the data before
sending it to a client. So the server thinks he wrote valid and complete data
which is not the case as it lost precision.
So in my opinion we can make this configurable. Services which care about
precision will have the current behaviour as it is to not lose data. Other
serivces might not care about such strict guidelines and we could just print
the string without an exception. If you see other options please let me know I
would be very grateful. This topic has been nagging me since the beginning
since for every other facet "null" just means unlimited in the specification.
This also makes it very hard for users to know why there is an exception in
this case.
Best Regards,
Christian
> Precision on EdmDateTimeOffset should be optional
> -------------------------------------------------
>
> Key: OLINGO-793
> URL: https://issues.apache.org/jira/browse/OLINGO-793
> Project: Olingo
> Issue Type: Bug
> Components: odata4-commons
> Affects Versions: (Java) V4 4.0.0
> Reporter: Ramesh Reddy
>
> According to [1] the precision attribute on EdmdateTimeOffset is optional
> facet that can be defined. However the code [2] fails with
> IllegalArgumentException is it found to be null.
> [1]
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397957
> [2]
> https://github.com/apache/olingo-odata4/blob/master/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/primitivetype/EdmDateTimeOffset.java#L253
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)