diff --git a/docs/odata-csdl-json/odata-csdl-json.html b/docs/odata-csdl-json/odata-csdl-json.html index 5b8fe91f..16c3c8b6 100644 --- a/docs/odata-csdl-json/odata-csdl-json.html +++ b/docs/odata-csdl-json/odata-csdl-json.html @@ -2765,6 +2765,7 @@

14.2.2 Target

14.3 Constant Expression

Constant expressions allow assigning a constant value to an applied term.

+

Primitive values of various types are represented as strings, therefore their type cannot be inferred from the constant expression alone. If such an ambiguous constant expression is an operand of a larger expression, clients MUST assume that the operand has the type demanded by the larger expression, for example, in a client-side function or in a comparison with another operand of known type. (In the $Le comparison in example 75 Duration is of type Edm.Duration, therefore the constant expression "PT1H" is a duration, not a string.)

14.3.1 Binary

@@ -3232,7 +3233,7 @@

$Eq, annotations.

-

Example 75:

+

Example 75:

{
   "$And": [
     {
@@ -3301,9 +3302,9 @@ 

$Eq, { "$Le": [ { - "$Path": "Price" + "$Path": "Duration" }, - 100 + "PT1H" ] }, { diff --git a/docs/odata-csdl-json/odata-csdl-json.md b/docs/odata-csdl-json/odata-csdl-json.md index 3e333fcc..f2bf8a5a 100644 --- a/docs/odata-csdl-json/odata-csdl-json.md +++ b/docs/odata-csdl-json/odata-csdl-json.md @@ -3928,6 +3928,14 @@ properties targeted via the declaring structured type. Constant expressions allow assigning a constant value to an applied term. +Primitive values of various types are represented as strings, therefore their type +cannot be inferred from the constant expression alone. If such +an ambiguous constant expression is an operand of a larger expression, clients MUST assume +that the operand has the type demanded by the larger expression, for example, in a +client-side function or in a comparison with another operand of known type. +(In the `$Le` comparison in [example 75](#disambiguate) `Duration` is of type +`Edm.Duration`, therefore the constant expression `"PT1H"` is a duration, not a string.) + ### 14.3.1 Binary ::: {.varjson .rep} @@ -4779,7 +4787,7 @@ They MAY contain [annotations](#Annotation). ::: ::: {.varjson .example} -Example 75: +Example 75: ```json { "$And": [ @@ -4849,9 +4857,9 @@ Example 75: { "$Le": [ { - "$Path": "Price" + "$Path": "Duration" }, - 100 + "PT1H" ] }, { diff --git a/docs/odata-csdl-xml/odata-csdl-xml.html b/docs/odata-csdl-xml/odata-csdl-xml.html index d05312d9..fcf049d4 100644 --- a/docs/odata-csdl-xml/odata-csdl-xml.html +++ b/docs/odata-csdl-xml/odata-csdl-xml.html @@ -3161,8 +3161,8 @@

Expressions ed <Int>20</Int> </Lt> <Le> - <Path>Price</Path> - <Int>100</Int> + <Path>Duration</Path> + <Duration>PT1H</Duration> </Le> <Has> <Path>Fabric</Path> diff --git a/docs/odata-csdl-xml/odata-csdl-xml.md b/docs/odata-csdl-xml/odata-csdl-xml.md index 2b3c58cd..5531fa7d 100644 --- a/docs/odata-csdl-xml/odata-csdl-xml.md +++ b/docs/odata-csdl-xml/odata-csdl-xml.md @@ -3737,6 +3737,7 @@ properties targeted via the declaring structured type. Constant expressions allow assigning a constant value to an applied term. + ### 14.3.1 Binary @@ -4757,8 +4758,8 @@ Example 75: 20 - Price - 100 + Duration + PT1H Fabric diff --git a/odata-csdl/14 Vocabulary and Annotation.md b/odata-csdl/14 Vocabulary and Annotation.md index d3a21948..6cd452a8 100644 --- a/odata-csdl/14 Vocabulary and Annotation.md +++ b/odata-csdl/14 Vocabulary and Annotation.md @@ -688,6 +688,16 @@ properties targeted via the declaring structured type. Constant expressions allow assigning a constant value to an applied term. +: varjson +Primitive values of various types are represented as strings, therefore their type +cannot be inferred from the constant expression alone. If such +an ambiguous constant expression is an operand of a larger expression, clients MUST assume +that the operand has the type demanded by the larger expression, for example, in a +client-side function or in a comparison with another operand of known type. +(In the `$Le` comparison in [example ##disambiguate] `Duration` is of type +`Edm.Duration`, therefore the constant expression `"PT1H"` is a duration, not a string.) +: + ### ##subsubsec Binary ::: {.varjson .rep} @@ -2012,7 +2022,7 @@ They MAY contain [annotations](#Annotation). ::: ::: {.varjson .example} -Example ##ex: +Example ##ex_disambiguate: ```json { "$And": [ @@ -2082,9 +2092,9 @@ Example ##ex: { "$Le": [ { - "$Path": "Price" + "$Path": "Duration" }, - 100 + "PT1H" ] }, { @@ -2175,8 +2185,8 @@ Example ##ex: 20 - Price - 100 + Duration + PT1H Fabric