[ 
https://issues.apache.org/jira/browse/OLINGO-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14949381#comment-14949381
 ] 

Ramesh Reddy commented on OLINGO-793:
-------------------------------------

Kind of confused ;) I keep reading [1] and I feel "precision" and "scale" 
attributes are setup to different standard of enforcement than, say MaxLength, 
just because they have default value of "0".  BTW this equally applies to 
Decimal. May be [~RalfHandl] can clarify bit.

from [1] 6.2.3 the text reads as
"For a decimal property the value of this attribute specifies the maximum 
number of digits allowed in the property’s value; it MUST be a positive 
integer. *If no value is specified, the decimal property has unspecified 
precision*.
For a temporal property the value of this attribute specifies the number of 
decimal places allowed in the seconds portion of the property’s value; it MUST 
be a non-negative integer between zero and twelve. *If no value is specified, 
the temporal property has a precision of zero.*"

IMO when no value is specified you should not restrict the data with 
constraints, rather allow the widest possible. The issue I am having is, I have 
no control over the data the coming in, that is another reason those properties 
are defined with no such facets to begin with.

[1] 
http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part3-csdl/odata-v4.0-errata02-os-part3-csdl-complete.html#_Toc406397954

> 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)

Reply via email to