Skip to content

Commit

Permalink
JSON Format
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Sep 9, 2024
1 parent 8763fcc commit 424111c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/odata-json-format/odata-json-format.html
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ <h3 id="4611-control-information-navigationlink-and-associationlink-odatanavigat
<details open><summary>
<h3 id="4612-control-information-media-odatamedia"><a id="ControlInformationmediaodatamedia" href="#ControlInformationmediaodatamedia">4.6.12 Control Information: <code>media*</code> (<code>odata.media*</code>)</a></h3>
</summary>
<p>For <a href="#MediaEntity">media entities</a> and <a href="#StreamProperty">stream properties</a> at least one of the control information <code>mediaEditLink</code> and <code>mediaReadLink</code> MUST be included in responses if they don't follow standard URL conventions as defined in <a href="#ODataURL">OData-URL</a>, sections 4.6 Addressing a property and 4.14 Addressing the Media Stream of a Media Entity, or if <a href="#metadatafullodatametadatafull"><code>metadata=full</code></a> is requested.</p>
<p>For <a href="#MediaEntity">media entities</a> and <a href="#StreamProperty">stream properties</a> at least one of the control information <code>mediaEditLink</code> and <code>mediaReadLink</code> MUST be included in responses if they don't follow standard URL conventions as defined in <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#AddressingaProperty">OData-URL, section “Addressing a Property”</a> and <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#AddressingtheMediaStreamofaMediaEntity">OData-URL, section “Addressing the Media Stream of a Media Entity</a>, or if <a href="#metadatafullodatametadatafull"><code>metadata=full</code></a> is requested.</p>
<p>The <code>mediaEditLink</code> control information contains a <a href="URLsinMessageBodies">URL</a> that can be used to update the binary stream associated with the media entity or stream property. It MUST be included for updatable streams if it differs from standard URL conventions relative to the edit link of the entity.</p>
<p>The <code>mediaReadLink</code> control information contains a URL that can be used to read the binary stream associated with the media entity or stream property. It MUST be included if its value differs from the value of the associated <code>mediaEditLink</code>, if present, or if it doesn’t follow standard URL conventions relative to the read link of the entity and the associated <code>mediaEditLink</code> is not present.</p>
<p>The <code>mediaContentType</code> control information MAY be included; its value SHOULD match the media type of the binary stream represented by the <code>mediaReadLink</code> URL. This is only a hint; the actual media type will be included in the <code>Content-Type</code> header when the resource is requested. The presence of <code>mediaContentType</code> with value <code>null</code> MAY be used to indicate the absence of a binary stream.</p>
Expand Down Expand Up @@ -2060,7 +2060,7 @@ <h1 id="18-action-invocation"><a id="ActionInvocation" href="#ActionInvocation">
<span id="cb58-9"><a href="#cb58-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;CustomerID&quot;</span><span class="fu">:</span> <span class="st">&quot;ALFKI&quot;</span></span>
<span id="cb58-10"><a href="#cb58-10" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
</div>
<p>Alternatively, values of non-binding parameters MAY be specified as common expressions <a href="#ODataURL">OData-URL, section 5.1.1</a>. In the case of a bound action these MAY contain path expressions <a href="#ODataURL">OData-URL, section 5.1.1.15</a>, which the service evaluates on the binding parameter value. Such parameters are encoded as name/value pairs where the name is the name of the parameter followed by <code>@expression</code> and the value is the common expression. As the following example demonstrates, non-transient entities can be passed as non-binding action parameters through a resource path in this way.</p>
<p>Alternatively, values of non-binding parameters MAY be specified as common expressions <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#CommonExpressionSyntax">OData-URL, section “Common Expression Syntax”</a>. In the case of a bound action these MAY contain path expressions <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#PathExpressions">OData-URL, section “Path Expressions”</a>, which the service evaluates on the binding parameter value. Such parameters are encoded as name/value pairs where the name is the name of the parameter followed by <code>@expression</code> and the value is the common expression. As the following example demonstrates, non-transient entities can be passed as non-binding action parameters through a resource path in this way.</p>
<div class="example">
<p>Example 53: An employee requests leave from their manager for the next two weeks:</p>
<div class="sourceCode" id="cb59"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a><span class="er">POST</span> <span class="er">/service/Employees(23)/self.RequestLeave</span></span>
Expand All @@ -2085,7 +2085,7 @@ <h1 id="18-action-invocation"><a id="ActionInvocation" href="#ActionInvocation">
<span id="cb60-9"><a href="#cb60-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">&quot;Approver@expression&quot;</span><span class="fu">:</span> <span class="st">&quot;$root/services/Employee(23)/Manager&quot;</span></span>
<span id="cb60-10"><a href="#cb60-10" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
</div>
<p>Inside a batch request the common expressions can also be value references starting with <code>$</code>, as introduced in <a href="#ODataProtocol">OData-Protocol, section 11.7.6</a>.</p>
<p>Inside a batch request the common expressions can also be value references starting with <code>$</code>, as introduced in <a href="https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#ReferencingValuesFromResponseBodies">OData-Protocol, section “Referencing Values from Response Bodies”</a>.</p>
<p>Non-binding parameters that are nullable or 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> defined in <a href="#ODataVocCore">OData-VocCore</a> MAY be omitted from the request body. If an omitted parameter is not annotated (and thus nullable), it MUST be interpreted as having the <code>null</code> value. If it is annotated and the annotation specifies a <code>DefaultValue</code>, the omitted parameter is interpreted as having that default value. If omitted and the annotation does not specify a default value, the service is free on how to interpret the omitted parameter. Note: a nullable non-binding parameter is equivalent to being annotated as optional with a default value of <code>null</code>.</p>
<div class="example">
<p>Example 54:</p>
Expand Down
9 changes: 5 additions & 4 deletions docs/odata-json-format/odata-json-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,8 @@ For [media entities](#MediaEntity) and [stream
properties](#StreamProperty) at least one of the control information
`mediaEditLink` and `mediaReadLink` MUST be included
in responses if they don\'t follow standard URL conventions as defined
in [OData-URL](#ODataURL), sections 4.6 Addressing a property and 4.14 Addressing the Media Stream of a Media Entity, or if
in [OData-URL, section "Addressing a Property"](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#AddressingaProperty)
and [OData-URL, section "Addressing the Media Stream of a Media Entity"](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#AddressingtheMediaStreamofaMediaEntity), or if
[`metadata=full`](#metadatafullodatametadatafull)
is requested.

Expand Down Expand Up @@ -3112,8 +3113,8 @@ Content-Type: application/json
:::

Alternatively, values of non-binding parameters MAY be specified as common expressions
[OData-URL, section 5.1.1](#ODataURL). In the case of a bound action
these MAY contain path expressions [OData-URL, section 5.1.1.15](#ODataURL), which
[OData-URL, section "Common Expression Syntax"](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#CommonExpressionSyntax). In the case of a bound action
these MAY contain path expressions [OData-URL, section "Path Expressions"](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part2-url-conventions.html#PathExpressions), which
the service evaluates on the binding parameter value. Such parameters are encoded as name/value
pairs where the name is the name of the parameter followed by `@expression` and
the value is the common expression. As the following example demonstrates,
Expand Down Expand Up @@ -3152,7 +3153,7 @@ Content-Type: application/json
:::

Inside a batch request the common expressions can also be value references
starting with `$`, as introduced in [OData-Protocol, section 11.7.6](#ODataProtocol).
starting with `$`, as introduced in [OData-Protocol, section "Referencing Values from Response Bodies"](https://docs.oasis-open.org/odata/odata/v4.02/odata-v4.02-part1-protocol.html#ReferencingValuesFromResponseBodies).

Non-binding parameters that are nullable or annotated with the term
[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter) defined in
Expand Down
6 changes: 3 additions & 3 deletions odata-json-format/16 Bound Function.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ Content-Type: application/json
:::

Alternatively, values of non-binding parameters MAY be specified as common expressions
[OData-URL, section 5.1.1](#ODataURL). In the case of a bound action
these MAY contain path expressions [OData-URL, section 5.1.1.15](#ODataURL), which
[OData-URL, section "Common Expression Syntax"]($$$OData-URL$$$#CommonExpressionSyntax). In the case of a bound action
these MAY contain path expressions [OData-URL, section "Path Expressions"]($$$OData-URL$$$#PathExpressions), which
the service evaluates on the binding parameter value. Such parameters are encoded as name/value
pairs where the name is the name of the parameter followed by `@expression` and
the value is the common expression. As the following example demonstrates,
Expand Down Expand Up @@ -325,7 +325,7 @@ Content-Type: application/json
:::

Inside a batch request the common expressions can also be value references
starting with `$`, as introduced in [OData-Protocol, section 11.7.6](#ODataProtocol).
starting with `$`, as introduced in [OData-Protocol, section "Referencing Values from Response Bodies"]($$$OData-Protocol$$$#ReferencingValuesFromResponseBodies).

Non-binding parameters that are nullable or annotated with the term
[`Core.OptionalParameter`](https://github.com/oasis-tcs/odata-vocabularies/blob/main/vocabularies/Org.OData.Core.V1.md#OptionalParameter) defined in
Expand Down
3 changes: 2 additions & 1 deletion odata-json-format/4 Common Characteristics.md
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,8 @@ For [media entities](#MediaEntity) and [stream
properties](#StreamProperty) at least one of the control information
`mediaEditLink` and `mediaReadLink` MUST be included
in responses if they don\'t follow standard URL conventions as defined
in [OData-URL](#ODataURL), sections 4.6 Addressing a property and 4.14 Addressing the Media Stream of a Media Entity, or if
in [OData-URL, section "Addressing a Property"]($$$OData-URL$$$#AddressingaProperty)
and [OData-URL, section "Addressing the Media Stream of a Media Entity"]($$$OData-URL$$$#AddressingtheMediaStreamofaMediaEntity), or if
[`metadata=full`](#metadatafullodatametadatafull)
is requested.

Expand Down

0 comments on commit 424111c

Please sign in to comment.