Skip to content

Commit

Permalink
Only example is representation-specific
Browse files Browse the repository at this point in the history
  • Loading branch information
ralfhandl committed Sep 27, 2024
1 parent 5aac772 commit d1d3db1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 49 deletions.
4 changes: 2 additions & 2 deletions docs/odata-csdl-json/odata-csdl-json.html
Original file line number Diff line number Diff line change
Expand Up @@ -2044,10 +2044,10 @@ <h3><a id="Nullable.14.4" href="#Nullable.14.4"><code>$Nullable</code></a></h3>
<p>The value of <code>$Nullable</code> is one of the Boolean literals <code>true</code> or <code>false</code>. Absence of the member means <code>false</code>.</p>
<p>For single-valued parameters the value <code>true</code> means that the parameter accepts a <code>null</code> value.</p>
<p>For collection-valued parameters the parameter value will always be a collection that MAY be empty. In this case <code>$Nullable</code> applies to items of the collection and specifies whether the collection MAY contain <code>null</code> values.</p>
</div>
<h3><a id="AnnotationCoreOptionalParameter.14.5" href="#AnnotationCoreOptionalParameter.14.5">Annotation <code>Core.OptionalParameter</code></a></h3>
<p>A <code>$Parameter</code> object annotated with the term <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter"><code>Core.OptionalParameter</code></a> MAY be omitted when invoking the function or action.</p>
<p>A parameter that is annotated with the term <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter"><code>Core.OptionalParameter</code></a> MAY be omitted when invoking the function or action.</p>
<p>All parameters marked as optional MUST come after any parameters not marked as optional. The binding parameter MUST NOT be marked as optional.</p>
</div>
<div class="varjson example">
<p>Example 30: a function returning the top-selling products for a given year. In this case the year must be specified as a parameter of the function with the <code>$Parameter</code> member.</p>
<div class="sourceCode" id="cb30"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="er">&quot;TopSellingProducts&quot;:</span> <span class="ot">[</span></span>
Expand Down
7 changes: 3 additions & 4 deletions docs/odata-csdl-json/odata-csdl-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -2984,14 +2984,15 @@ For collection-valued parameters the parameter value will always be a
collection that MAY be empty. In this case `$Nullable` applies to items
of the collection and specifies whether the collection MAY contain
`null` values.
:::


### <a id="AnnotationCoreOptionalParameter.14.5" href="#AnnotationCoreOptionalParameter.14.5">Annotation `Core.OptionalParameter`</a>

A `$Parameter` object annotated with the term [`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter) MAY be omitted when invoking the function or action.
A parameter that is annotated with the term [`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter) MAY be omitted when invoking the function or action.

All parameters marked as optional MUST come after any parameters not marked as optional.
The binding parameter MUST NOT be marked as optional.
:::

::: {.varjson .example}
Example 30: a function returning the top-selling products for a given
Expand Down Expand Up @@ -3019,8 +3020,6 @@ function with the `$Parameter` member.
```
:::



### <a id="AnnotationCoreIsDelta.14.6" href="#AnnotationCoreIsDelta.14.6">Annotation `Core.IsDelta`</a>

A parameter that accepts a single entity or a collection of entities MAY accept a delta representation.
Expand Down
4 changes: 2 additions & 2 deletions docs/odata-csdl-xml/odata-csdl-xml.html
Original file line number Diff line number Diff line change
Expand Up @@ -1926,10 +1926,10 @@ <h3><a id="AttributeType.23.2" href="#AttributeType.23.2">Attribute <code>Type</
<h3><a id="AttributeNullable.23.3" href="#AttributeNullable.23.3">Attribute <code>Nullable</code></a></h3>
<p>The value of <code>Nullable</code> is one of the Boolean literals <code>true</code> or <code>false</code>. Absence of the attribute means <code>true</code>.</p>
<p>The value <code>true</code> means that the parameter accepts a <code>null</code> value.</p>
</div>
<h3><a id="AnnotationCoreOptionalParameter.23.4" href="#AnnotationCoreOptionalParameter.23.4">Annotation <code>Core.OptionalParameter</code></a></h3>
<p>An <code>edm:Parameter</code> element that is annotated with the term <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter"><code>Core.OptionalParameter</code></a> MAY be omitted when invoking the function or action.</p>
<p>A parameter that is annotated with the term <a href="https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter"><code>Core.OptionalParameter</code></a> MAY be omitted when invoking the function or action.</p>
<p>All parameters marked as optional MUST come after any parameters not marked as optional. The binding parameter MUST NOT be marked as optional.</p>
</div>
<div class="varxml example">
<p>Example 30: a function returning the top-selling products for a given year. In this case the year must be specified as a parameter of the function with the <code>edm:Parameter</code> element.</p>
<div class="sourceCode" id="cb30"><pre class="sourceCode xml"><code class="sourceCode xml"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a>&lt;<span class="kw">Function</span><span class="ot"> Name=</span><span class="st">&quot;TopSellingProducts&quot;</span>&gt;</span>
Expand Down
5 changes: 2 additions & 3 deletions docs/odata-csdl-xml/odata-csdl-xml.md
Original file line number Diff line number Diff line change
Expand Up @@ -2819,7 +2819,6 @@ the parameter value is a collection, the facets apply to the items in
the collection.



::: {.varxml .rep}
### <a id="ElementedmParameter.23" href="#ElementedmParameter.23">Element `edm:Parameter`</a>

Expand Down Expand Up @@ -2849,14 +2848,14 @@ The value of `Nullable` is one of the Boolean literals `true` or
`false`. Absence of the attribute means `true`.

The value `true` means that the parameter accepts a `null` value.
:::

### <a id="AnnotationCoreOptionalParameter.23.4" href="#AnnotationCoreOptionalParameter.23.4">Annotation `Core.OptionalParameter`</a>

An `edm:Parameter` element that is annotated with the term [`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter) MAY be omitted when invoking the function or action.
A parameter that is annotated with the term [`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter) MAY be omitted when invoking the function or action.

All parameters marked as optional MUST come after any parameters not marked as optional.
The binding parameter MUST NOT be marked as optional.
:::

::: {.varxml .example}
Example 30: a function returning the top-selling products for a given
Expand Down
65 changes: 27 additions & 38 deletions odata-csdl/12 Action and Function.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,42 +404,6 @@ For collection-valued parameters the parameter value will always be a
collection that MAY be empty. In this case `$Nullable` applies to items
of the collection and specifies whether the collection MAY contain
`null` values.

### ##subisec Annotation `Core.OptionalParameter`

A `$Parameter` object annotated with the term
[`Core.OptionalParameter`]($$$OData-VocCore$$$#OptionalParameter) MAY be
omitted when invoking the function or action.

All parameters marked as optional MUST come after any parameters not marked as optional.

The binding parameter MUST NOT be marked as optional.
:::

::: {.varjson .example}
Example ##ex: a function returning the top-selling products for a given
year. In this case the year must be specified as a parameter of the
function with the `$Parameter` member.
```json
"TopSellingProducts": [
{
"$Kind": "Function",
"$Parameter": [
{
"$Name": "Year",
"$Nullable": true,
"$Type": "Edm.Decimal",
"$Precision": 4,
"$Scale": 0
}
],
"$ReturnType": {
"$Collection": true,
"$Type": "self.Product"
}
}
]
```
:::

::: {.varxml .rep}
Expand Down Expand Up @@ -471,18 +435,43 @@ The value of `Nullable` is one of the Boolean literals `true` or
`false`. Absence of the attribute means `true`.

The value `true` means that the parameter accepts a `null` value.
:::

### ##subisec Annotation `Core.OptionalParameter`

An `edm:Parameter` element that is annotated with the term
A parameter that is annotated with the term
[`Core.OptionalParameter`]($$$OData-VocCore$$$#OptionalParameter) MAY be
omitted when invoking the function or action.

All parameters marked as optional MUST come after any parameters not marked as optional.

The binding parameter MUST NOT be marked as optional.
:::

::: {.varjson .example}
Example ##ex: a function returning the top-selling products for a given
year. In this case the year must be specified as a parameter of the
function with the `$Parameter` member.
```json
"TopSellingProducts": [
{
"$Kind": "Function",
"$Parameter": [
{
"$Name": "Year",
"$Nullable": true,
"$Type": "Edm.Decimal",
"$Precision": 4,
"$Scale": 0
}
],
"$ReturnType": {
"$Collection": true,
"$Type": "self.Product"
}
}
]
```
:::
::: {.varxml .example}
Example ##ex: a function returning the top-selling products for a given
year. In this case the year must be specified as a parameter of the
Expand Down

0 comments on commit d1d3db1

Please sign in to comment.