Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bound actions and function overloads via container and structured type #233

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
66 changes: 63 additions & 3 deletions docs/odata-csdl-json/odata-csdl-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,16 @@ <h2 id="11-changes-from-earlier-versions"><a name="ChangesfromEarlierVersions" h
</thead>
<tbody>
<tr class="odd">
<td><a href="#Target">Section 14.2.2</a></td>
<td>External targeting of bound action/function overloads via container or structured type</td>
<td><a href="https://issues.oasis-open.org/browse/ODATA-1626">ODATA-1626</a></td>
</tr>
<tr class="even">
<td><a href="#PathEvaluation">Section 14.4.1.2</a></td>
<td>New path evaluation rules for annotations targeting annotations and external targeting via container</td>
<td><a href="https://issues.oasis-open.org/browse/ODATA-1420">ODATA-1420</a></td>
</tr>
<tr class="even">
<tr class="odd">
<td><a href="#PrimitiveTypes">Section 3.3</a></td>
<td>Allow stream-valued non-binding parameters</td>
<td><a href="https://issues.oasis-open.org/browse/ODATA-1481">ODATA-1481</a></td>
Expand Down Expand Up @@ -2266,7 +2271,7 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
<tr class="header">
<th>Model element</th>
<th>Can be targeted with path expression (see also <a href="#PathSyntax">section 14.4.1.1</a>)</th>
<th><div class="example"><p>Example 42: Target expressions</p></div></th>
<th><div class="example"><p style="margin-top:0">Example 42: Target expressions</p></div></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -2358,7 +2363,7 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
<tr class="even">
<td><a href="#StructuralProperty">Property</a> via container</td>
<td>qualified name of entity container followed by a segment containing a singleton or entity set name and zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast</td>
<td><pre><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MySchema.MyEntityType/MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyComplexProperty/MyProperty</code></pre></td>
<td><pre><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MySchema.MyEntityType/MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyComplexProperty/MyProperty</code></pre></td>
</tr>
<tr class="odd">
<td><a href="#StructuralProperty">Property</a> via structured type</td>
Expand Down Expand Up @@ -2394,6 +2399,61 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
</table>
<p>All <a href="#QualifiedName">qualified names</a> used in a target path MUST be in scope.</p>
<p>External targeting is possible for properties and navigation properties of singletons or entities in a particular entity set. These annotations override annotations on the properties or navigation properties targeted via the declaring structured type.</p>
<p>External targeting is also possible for bound action and function overloads whose binding parameter is addressed via a certain path or has a certain type, as well as for parameters and return types thereof. The targeting expression then consists of two path expressions from the table above separated by a forward slash. The first path expression references one of the following model elements:</p>
<table>
<thead>
<tr class="header">
<th>Model element</th>
<th>means the binding parameter must be</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Entity Set</td>
<td>an instance or collection of instances from the entity set</td>
</tr>
<tr class="even">
<td>Singleton</td>
<td>the singleton</td>
</tr>
<tr class="odd">
<td>Navigation Property via container</td>
<td>addressed via the resource path to the navigation property</td>
</tr>
<tr class="even">
<td>Property via container</td>
<td>addressed via the resource path to the property</td>
</tr>
<tr class="odd">
<td>Navigation Property via structured type</td>
<td>addressed by a path that traverses the structured type</td>
</tr>
<tr class="even">
<td>Property via structured type</td>
<td>addressed by a path that traverses the structured type</td>
</tr>
<tr class="odd">
<td>Complex Type</td>
<td>an instance or collection of the type or a subtype thereof</td>
</tr>
<tr class="even">
<td>Entity Type</td>
<td>an instance or collection of the type or a subtype thereof</td>
</tr>
</tbody>
</table>
<p>A binding parameter is “addressed via a resource path” if the path expression addressing the binding parameter starts with the resource path, it may then continue with segments described in <a href="#ODataURL">OData-URL</a>, sections 4.6 through 4.12. If the resource path addresses a collection, the binding parameter can also be a single instance of that collection if a segment described in <a href="#ODataURL">OData-URL</a>, sections 4.9 and 4.10, follows.</p>
<p>The second path expression references one of the following model elements:</p>
<ul>
<li>Action overload</li>
<li>all overloads of an Action</li>
<li>Function overload</li>
<li>all overloads of a Function</li>
<li>Parameter</li>
<li>Return Type</li>
</ul>
<p>where the overload is bound and the binding parameter meets the condition imposed by the first path expression.</p>
<p>These annotations override annotations targeting the action or function overloads directly.</p>
<h2 id="143-constant-expression"><a name="ConstantExpression" href="#ConstantExpression">14.3 Constant Expression</a></h2>
<p>Constant expressions allow assigning a constant value to an applied term.</p>
<h3 id="1431-binary"><a name="Binary" href="#Binary">14.3.1 Binary</a></h3>
Expand Down
43 changes: 41 additions & 2 deletions docs/odata-csdl-json/odata-csdl-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ modifications made necessary to fully cover OData CSDL Version 4.01.

Section | Feature / Change | Issue
--------|------------------|------
[Section 14.2.2](#Target)| External targeting of bound action/function overloads via container or structured type| [ODATA-1626](https://issues.oasis-open.org/browse/ODATA-1626)
[Section 14.4.1.2](#PathEvaluation)| New path evaluation rules for annotations targeting annotations and external targeting via container| [ODATA-1420](https://issues.oasis-open.org/browse/ODATA-1420)
[Section 3.3](#PrimitiveTypes)| Allow stream-valued non-binding parameters| [ODATA-1481](https://issues.oasis-open.org/browse/ODATA-1481)

Expand Down Expand Up @@ -3838,7 +3839,7 @@ These are the direct children of a schema with a unique name (i.e.
except actions and functions whose overloads to not possess a natural
identifier), and all direct children of an entity container.

Model element| Can be targeted with path expression (see also [section 14.4.1.1](#PathSyntax))| <div class="example"><p>Example 42: Target expressions</p></div>
Model element| Can be targeted with path expression (see also [section 14.4.1.1](#PathSyntax))| <div class="example"><p style="margin-top:0">Example 42: Target expressions</p></div>
-----|-----|-----
[Action](#Action) overload| qualified name of action followed by parentheses containing the binding parameter type of a bound action overload to identify that bound overload, or by empty parentheses to identify the unbound overload| <pre>`MySchema.MyAction(MySchema.MyBindingType)` <br>`MySchema.MyAction(Collection(MySchema.BindingType))` <br>`MySchema.MyAction()`</pre>
all overloads of an [Action](#Action)| qualified name of action| <pre>`MySchema.MyAction`</pre>
Expand All @@ -3857,7 +3858,7 @@ all overloads of a [Function](#Function)| qualified name of function| <pre>`MySc
[Navigation Property](#NavigationProperty) via structured type| qualified name of structured type followed by zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast| <pre>`MySchema.MyEntityType/MyNavigationProperty` <br>`MySchema.MyComplexType/MyNavigationProperty`</pre>
[Parameter](#Parameter)| qualified name of entity container followed by a segment containing an action or function import name followed by a segment containing a parameter name| <pre>`MySchema.MyEntityContainer/MyFunctionImport/MyParameter`</pre>
[Parameter](#Parameter)| qualified name of action or function optionally followed by a parenthesized expression as in the first row followed by a segment containing the name of a child element| <pre>`MySchema.MyFunction/MyParameter`</pre>
[Property](#StructuralProperty) via container| qualified name of entity container followed by a segment containing a singleton or entity set name and zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast| <pre>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MyProperty` <br>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MySchema.MyEntityType/MyProperty` <br>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MyComplexProperty/MyProperty`</pre>
[Property](#StructuralProperty) via container| qualified name of entity container followed by a segment containing a singleton or entity set name and zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast| <pre>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MyProperty` <br>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MySchema.MyEntityType/MyProperty` <br>`MySchema.MyEntityContainer/MyEntitySet` <br>` /MyComplexProperty/MyProperty`</pre>
[Property](#StructuralProperty) via structured type| qualified name of structured type followed by zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast| <pre>`MySchema.MyEntityType/MyProperty` <br>`MySchema.MyComplexType/MyProperty`</pre>
[Return Type](#ReturnType)| qualified name of entity container followed by a segment containing an action or function import name followed by a segment containing `$ReturnType`| <pre>`MySchema.MyEntityContainer/MyFunctionImport/$ReturnType`</pre>
[Return Type](#ReturnType)| qualified name of action or function optionally followed by a parenthesized expression as in the first row followed by a segment containing `$ReturnType`| <pre>`MySchema.MyFunction/$ReturnType` <br>`MySchema.MyFunction(MySchema.MyBindingParamType,` <br>` First.NonBinding.ParamType)/$ReturnType`</pre>
Expand All @@ -3872,6 +3873,44 @@ properties of singletons or entities in a particular entity set. These
annotations override annotations on the properties or navigation
properties targeted via the declaring structured type.

External targeting is also possible for bound action and function overloads
whose binding parameter is addressed via a certain path or has a certain type,
as well as for parameters and return types thereof. The targeting expression then
consists of two path expressions from the table above separated by a forward
slash. The first path expression references one of the following model
elements:

Model element|means the binding parameter must be
-------------|-----------------------------------
Entity Set|an instance or collection of instances from the entity set
Singleton|the singleton
Navigation Property via container|addressed via the resource path to the navigation property
Property via container|addressed via the resource path to the property
Navigation Property via structured type|addressed by a path that traverses the structured type
Property via structured type|addressed by a path that traverses the structured type
Complex Type|an instance or collection of the type or a subtype thereof
Entity Type|an instance or collection of the type or a subtype thereof

A binding parameter is "addressed via a resource path" if the path expression addressing the
binding parameter starts with the resource path, it may then continue with segments
described in [OData-URL](#ODataURL), sections 4.6 through 4.12. If the resource path
addresses a collection, the binding parameter can also be a single instance of that
collection if a segment described in [OData-URL](#ODataURL), sections 4.9 and 4.10, follows.

The second path expression references one of the following model elements:
- Action overload
- all overloads of an Action
- Function overload
- all overloads of a Function
- Parameter
- Return Type

where the overload is bound and the binding parameter meets the condition
imposed by the first path expression.

These annotations override annotations targeting the action or function
overloads directly.

## <a name="ConstantExpression" href="#ConstantExpression">14.3 Constant Expression</a>

Constant expressions allow assigning a constant value to an applied
Expand Down
66 changes: 63 additions & 3 deletions docs/odata-csdl-xml/odata-csdl-xml.html
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,16 @@ <h2 id="11-changes-from-earlier-versions"><a name="ChangesfromEarlierVersions" h
<td><a href="https://issues.oasis-open.org/browse/ODATA-1571">ODATA-1571</a></td>
</tr>
<tr class="even">
<td><a href="#Target">Section 14.2.2</a></td>
<td>External targeting of bound action/function overloads via container or structured type</td>
<td><a href="https://issues.oasis-open.org/browse/ODATA-1626">ODATA-1626</a></td>
</tr>
<tr class="odd">
<td><a href="#PathEvaluation">Section 14.4.1.2</a></td>
<td>New path evaluation rules for annotations targeting annotations and external targeting via container</td>
<td><a href="https://issues.oasis-open.org/browse/ODATA-1420">ODATA-1420</a></td>
</tr>
<tr class="odd">
<tr class="even">
<td><a href="#PrimitiveTypes">Section 3.3</a></td>
<td>Allow stream-valued non-binding parameters</td>
<td><a href="https://issues.oasis-open.org/browse/ODATA-1481">ODATA-1481</a></td>
Expand Down Expand Up @@ -2082,7 +2087,7 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
<tr class="header">
<th>Model element</th>
<th>Can be targeted with path expression (see also <a href="#PathSyntax">section 14.4.1.1</a>)</th>
<th><div class="example"><p>Example 42: Target expressions</p></div></th>
<th><div class="example"><p style="margin-top:0">Example 42: Target expressions</p></div></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -2174,7 +2179,7 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
<tr class="even">
<td><a href="#StructuralProperty">Property</a> via container</td>
<td>qualified name of entity container followed by a segment containing a singleton or entity set name and zero or more segments containing the name of a structural or navigation property, or a type-cast or term-cast</td>
<td><pre><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MySchema.MyEntityType/MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyComplexProperty/MyProperty</code></pre></td>
<td><pre><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MySchema.MyEntityType/MyProperty</code> <br><code>MySchema.MyEntityContainer/MyEntitySet</code> <br><code> /MyComplexProperty/MyProperty</code></pre></td>
</tr>
<tr class="odd">
<td><a href="#StructuralProperty">Property</a> via structured type</td>
Expand Down Expand Up @@ -2210,6 +2215,61 @@ <h3 id="1422-target"><a name="Target" href="#Target">14.2.2 Target</a></h3>
</table>
<p>All <a href="#QualifiedName">qualified names</a> used in a target path MUST be in scope.</p>
<p>External targeting is possible for properties and navigation properties of singletons or entities in a particular entity set. These annotations override annotations on the properties or navigation properties targeted via the declaring structured type.</p>
<p>External targeting is also possible for bound action and function overloads whose binding parameter is addressed via a certain path or has a certain type, as well as for parameters and return types thereof. The targeting expression then consists of two path expressions from the table above separated by a forward slash. The first path expression references one of the following model elements:</p>
<table>
<thead>
<tr class="header">
<th>Model element</th>
<th>means the binding parameter must be</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Entity Set</td>
<td>an instance or collection of instances from the entity set</td>
</tr>
<tr class="even">
<td>Singleton</td>
<td>the singleton</td>
</tr>
<tr class="odd">
<td>Navigation Property via container</td>
<td>addressed via the resource path to the navigation property</td>
</tr>
<tr class="even">
<td>Property via container</td>
<td>addressed via the resource path to the property</td>
</tr>
<tr class="odd">
<td>Navigation Property via structured type</td>
<td>addressed by a path that traverses the structured type</td>
</tr>
<tr class="even">
<td>Property via structured type</td>
<td>addressed by a path that traverses the structured type</td>
</tr>
<tr class="odd">
<td>Complex Type</td>
<td>an instance or collection of the type or a subtype thereof</td>
</tr>
<tr class="even">
<td>Entity Type</td>
<td>an instance or collection of the type or a subtype thereof</td>
</tr>
</tbody>
</table>
<p>A binding parameter is “addressed via a resource path” if the path expression addressing the binding parameter starts with the resource path, it may then continue with segments described in <a href="#ODataURL">OData-URL</a>, sections 4.6 through 4.12. If the resource path addresses a collection, the binding parameter can also be a single instance of that collection if a segment described in <a href="#ODataURL">OData-URL</a>, sections 4.9 and 4.10, follows.</p>
<p>The second path expression references one of the following model elements:</p>
<ul>
<li>Action overload</li>
<li>all overloads of an Action</li>
<li>Function overload</li>
<li>all overloads of a Function</li>
<li>Parameter</li>
<li>Return Type</li>
</ul>
<p>where the overload is bound and the binding parameter meets the condition imposed by the first path expression.</p>
<p>These annotations override annotations targeting the action or function overloads directly.</p>
<h2 id="143-constant-expression"><a name="ConstantExpression" href="#ConstantExpression">14.3 Constant Expression</a></h2>
<p>Constant expressions allow assigning a constant value to an applied term.</p>
<h3 id="1431-binary"><a name="Binary" href="#Binary">14.3.1 Binary</a></h3>
Expand Down