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

Parameter aliases in $apply #2003

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,7 @@ <h1 id="3-system-query-option-apply"><a id="SystemQueryOptionapply" href="#Syste
<p>Instances of an output set can contain structural and navigation properties, which can be declared or dynamic, as well as instance annotations.</p>
<p>The allowed set transformations are defined in this section as well as in the section on <a href="#HierarchicalTransformations">Hierarchical Transformations</a>.</p>
<p>Service-defined bound functions that take a collection of instances of a structured type as their binding parameter and return a collection of instances of a structured type MAY be used as set transformations within <code>$apply</code>. Further transformations can follow the bound function. The parameter syntax for bound function segments is identical to the parameter syntax for bound functions in resource path segments or <code>$filter</code> expressions. See <a href="#ModelFunctionsasSetTransformations">section 7.7</a> for an example.</p>
<p>Parameter aliases <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#ParameterAliases">OData-URL, section 5.3</a> can be used inside the value of <code>$apply</code> wherever the ABNF rule <code>applyTrafo</code> <a href="#ODataABNF">OData-ABNF</a> is reduced to a <code>commonExpr</code> <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#CommonExpressionSyntax">OData-URL, section 5.1.1</a> or a <code>collectionExpr</code> (<a href="#ExpressionsEvaluableonaCollection">section 3.6</a>).</p>
<p>If a data service that supports <code>$apply</code> does not support it on the collection identified by the request resource path, it MUST fail with <code>501 Not Implemented</code> and a meaningful human-readable error message.</p>
<p>On resource paths ending in <code>/$count</code> the system query option <code>$apply</code> is evaluated on the set identified by the resource path without the <code>/$count</code> segment, the result is the plain-text number of items in the result of <code>$apply</code>. This is similar to the combination of <code>/$count</code> and <code>$filter</code>.</p>
<p>During serialization of the result of <code>$apply</code> declared properties and dynamic properties are represented as defined by the response format. Other properties have been aggregated away and are not represented in the response. The entities returned in the request examples in the following sections that involve aggregation are therefore transient.</p>
Expand Down
2 changes: 2 additions & 0 deletions docs/odata-data-aggregation-ext/odata-data-aggregation-ext.md
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,8 @@ The allowed set transformations are defined in this section as well as in the se

Service-defined bound functions that take a collection of instances of a structured type as their binding parameter and return a collection of instances of a structured type MAY be used as set transformations within `$apply`. Further transformations can follow the bound function. The parameter syntax for bound function segments is identical to the parameter syntax for bound functions in resource path segments or `$filter` expressions. See [section 7.7](#ModelFunctionsasSetTransformations) for an example.

Parameter aliases [OData-URL, section 5.3](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#ParameterAliases) can be used inside the value of `$apply` wherever the ABNF rule `applyTrafo` [OData-ABNF](#ODataABNF) is reduced to a `commonExpr` [OData-URL, section 5.1.1](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#CommonExpressionSyntax) or a `collectionExpr` ([section 3.6](#ExpressionsEvaluableonaCollection)).

If a data service that supports `$apply` does not support it on the collection identified by the request resource path, it MUST fail with `501 Not Implemented` and a meaningful human-readable error message.

On resource paths ending in `/$count` the system query option `$apply` is evaluated on the set identified by the resource path without the `/$count` segment, the result is the plain-text number of items in the result of `$apply`. This is similar to the combination of `/$count` and `$filter`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ The allowed set transformations are defined in this section as well as in the se

Service-defined bound functions that take a collection of instances of a structured type as their binding parameter and return a collection of instances of a structured type MAY be used as set transformations within `$apply`. Further transformations can follow the bound function. The parameter syntax for bound function segments is identical to the parameter syntax for bound functions in resource path segments or `$filter` expressions. See [section ##ModelFunctionsasSetTransformations] for an example.

Parameter aliases [#OData-URL#ParameterAliases] can be used inside the value of `$apply` wherever the ABNF rule `applyTrafo` [OData-ABNF](#ODataABNF) is reduced to a `commonExpr` [#OData-URL#CommonExpressionSyntax] or a `collectionExpr` ([section ##ExpressionsEvaluableonaCollection]).

If a data service that supports `$apply` does not support it on the collection identified by the request resource path, it MUST fail with `501 Not Implemented` and a meaningful human-readable error message.

On resource paths ending in `/$count` the system query option `$apply` is evaluated on the set identified by the resource path without the `/$count` segment, the result is the plain-text number of items in the result of `$apply`. This is similar to the combination of `/$count` and `$filter`.
Expand Down
Loading