From a1dbba30aa281993cb3914be08f134b7633ac48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiko=20Thei=C3=9Fen?= Date: Thu, 5 Sep 2024 14:08:21 +0200 Subject: [PATCH] example with duration --- docs/odata-csdl-json/odata-csdl-json.html | 8 ++++---- docs/odata-csdl-json/odata-csdl-json.md | 11 +++++------ docs/odata-csdl-xml/odata-csdl-xml.html | 6 +++--- docs/odata-csdl-xml/odata-csdl-xml.md | 6 +++--- odata-csdl/14 Vocabulary and Annotation.md | 17 ++++++++--------- 5 files changed, 23 insertions(+), 25 deletions(-) diff --git a/docs/odata-csdl-json/odata-csdl-json.html b/docs/odata-csdl-json/odata-csdl-json.html index 9e933238..a4878f77 100644 --- a/docs/odata-csdl-json/odata-csdl-json.html +++ b/docs/odata-csdl-json/odata-csdl-json.html @@ -2763,7 +2763,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 $Has comparison in example 75 Fabric has an enumeration type, therefore the constant expression "Blue" is an enumeration member, not a string or a binary value.)

+

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

@@ -3300,9 +3300,9 @@

$E { "$Le": [ { - "$Path": "Price" + "$Path": "Duration" }, - 100 + "PT1H" ] }, { @@ -3310,7 +3310,7 @@

$E { "$Path": "Fabric" }, - "Blue" + "Red" ] }, { diff --git a/docs/odata-csdl-json/odata-csdl-json.md b/docs/odata-csdl-json/odata-csdl-json.md index 0f02de33..9efea62c 100644 --- a/docs/odata-csdl-json/odata-csdl-json.md +++ b/docs/odata-csdl-json/odata-csdl-json.md @@ -3933,9 +3933,8 @@ 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 `$Has` comparison in [example 75](#disambiguate) `Fabric` has an enumeration type, -therefore the constant expression `"Blue"` is an -enumeration member, not a string or a binary value.) +(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 @@ -4858,9 +4857,9 @@ Example 75: { "$Le": [ { - "$Path": "Price" + "$Path": "Duration" }, - 100 + "PT1H" ] }, { @@ -4868,7 +4867,7 @@ Example 75: { "$Path": "Fabric" }, - "Blue" + "Red" ] }, { diff --git a/docs/odata-csdl-xml/odata-csdl-xml.html b/docs/odata-csdl-xml/odata-csdl-xml.html index b19a3515..fdea99ef 100644 --- a/docs/odata-csdl-xml/odata-csdl-xml.html +++ b/docs/odata-csdl-xml/odata-csdl-xml.html @@ -3159,12 +3159,12 @@

<Int>20</Int> </Lt> <Le> - <Path>Price</Path> - <Int>100</Int> + <Path>Duration</Path> + <Duration>PT1H</Duration> </Le> <Has> <Path>Fabric</Path> - <EnumMember>org.example.Pattern/Blue</EnumMember> + <EnumMember>org.example.Pattern/Red</EnumMember> </Has> <In> <Path>Size</Path> diff --git a/docs/odata-csdl-xml/odata-csdl-xml.md b/docs/odata-csdl-xml/odata-csdl-xml.md index 1c871879..479e66b2 100644 --- a/docs/odata-csdl-xml/odata-csdl-xml.md +++ b/docs/odata-csdl-xml/odata-csdl-xml.md @@ -4758,12 +4758,12 @@ Example 75: 20 - Price - 100 + Duration + PT1H Fabric - org.example.Pattern/Blue + org.example.Pattern/Red Size diff --git a/odata-csdl/14 Vocabulary and Annotation.md b/odata-csdl/14 Vocabulary and Annotation.md index ac6640a6..cf1bd77d 100644 --- a/odata-csdl/14 Vocabulary and Annotation.md +++ b/odata-csdl/14 Vocabulary and Annotation.md @@ -694,9 +694,8 @@ 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 `$Has` comparison in [example ##disambiguate] `Fabric` has an enumeration type, -therefore the constant expression `"Blue"` is an -enumeration member, not a string or a binary value.) +(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 @@ -2093,9 +2092,9 @@ Example ##ex_disambiguate: { "$Le": [ { - "$Path": "Price" + "$Path": "Duration" }, - 100 + "PT1H" ] }, { @@ -2103,7 +2102,7 @@ Example ##ex_disambiguate: { "$Path": "Fabric" }, - "Blue" + "Red" ] }, { @@ -2186,12 +2185,12 @@ Example ##ex: 20 - Price - 100 + Duration + PT1H Fabric - org.example.Pattern/Blue + org.example.Pattern/Red Size