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

null result with instance annotations #2019

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions docs/odata-json-format/odata-json-format.html
Original file line number Diff line number Diff line change
Expand Up @@ -1270,9 +1270,9 @@ <h1 id="11-individual-property-or-operation-response"><a id="IndividualPropertyo
</summary>
<p>An individual property or operation response is represented as a JSON object.</p>
<p>A single-valued property or operation response that has the <code>null</code> value does not have a representation; see <a href="#ODataProtocol">OData-Protocol</a>.</p>
<p>A property or operation response that is of a primitive type is represented as an object with a single name/value pair, whose name is <code>value</code> and whose value is a <a href="#PrimitiveValue">primitive value</a>.</p>
<p>A property or operation response that is of a primitive type is represented as an object with a name/value pair whose name is <code>value</code> and whose value is a <a href="#PrimitiveValue">primitive value</a> or <code>null</code>.</p>
<p>A property or operation response that is of complex type is represented as a <a href="#ComplexValue">complex value</a>.</p>
<p>A property or operation response that is of a collection type is represented as an object with a single name/value pair whose name is <code>value</code>. Its value is the JSON representation of a <a href="#CollectionofComplexValues">collection of complex type values</a> or <a href="#CollectionofPrimitiveValues">collection of primitive values</a>.</p>
<p>A property or operation response that is of a collection type is represented as an object with a name/value pair whose name is <code>value</code>. Its value is the JSON representation of a <a href="#CollectionofComplexValues">collection of complex type values</a> or <a href="#CollectionofPrimitiveValues">collection of primitive values</a>.</p>
<div class="example">
<p>Example 26: primitive value</p>
<div class="sourceCode" id="cb28"><pre class="sourceCode json"><code class="sourceCode json"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
Expand Down
6 changes: 3 additions & 3 deletions docs/odata-json-format/odata-json-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -1901,15 +1901,15 @@ A single-valued property or operation response that has the
[OData-Protocol](#ODataProtocol).

A property or operation response that is of a primitive type is
represented as an object with a single name/value pair, whose name is
represented as an object with a name/value pair whose name is
`value` and whose value is a [primitive
value](#PrimitiveValue).
value](#PrimitiveValue) or `null`.

A property or operation response that is of complex type is represented
as a [complex value](#ComplexValue).

A property or operation response that is of a collection type is
represented as an object with a single name/value pair whose name is
represented as an object with a name/value pair whose name is
`value`. Its value is the JSON representation of a
[collection of complex type values](#CollectionofComplexValues) or
[collection of primitive values](#CollectionofPrimitiveValues).
Expand Down
5 changes: 4 additions & 1 deletion docs/odata-protocol/odata-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,10 @@ <h3 id="913-response-code-202-accepted"><a id="ResponseCode202Accepted" href="#R
<details open><summary>
<h3 id="914-response-code-204-no-content"><a id="ResponseCode204NoContent" href="#ResponseCode204NoContent">9.1.4 Response Code <code>204 No Content</code></a></h3>
</summary>
<p>A request returns <code>204 No Content</code> if the requested resource has the <code>null</code> value, or if the service applies a <a href="#Preferencereturnrepresentationandreturnminimal"><code>return=minimal</code></a> preference. In this case, the response body MUST be empty.</p>
<p>A request returns <code>204 No Content</code> if the requested resource has the <code>null</code> value and carries no control information <a href="https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html#ControlInformation">OData-JSON, section 4.6</a> other than what the minimal metadata format <a href="https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html#metadataminimalodatametadataminimal">OData-JSON, section 3.1.1</a> demands and no <a href="#VocabularyExtensibility">instance annotations</a>.</p>
<p>If the requested resource has the <code>null</code> value but carries additional control information or instance annotations, the request returns <a href="#ResponseCode200OK"><code>200 OK</code></a> instead but omits the <a href="#ContextURL">context URL</a> from the representation of the response, which then consists of the other control information and instance annotations only.</p>
<p>A request always returns <code>204 No Content</code> if the service applies a <a href="#Preferencereturnrepresentationandreturnminimal"><code>return=minimal</code></a> preference.</p>
<p>With response code <code>204</code>, the response body MUST be empty.</p>
<p>As defined in <a href="#rfc9110">RFC9110</a>, a <a href="#DataModification">Data Modification Request</a> that responds with <code>204 No Content</code> MAY include an <a href="#HeaderETag"><code>ETag</code></a> header with a value reflecting the result of the data modification if and only if the client can reasonably “know” the new representation of the resource without actually receiving it. For a <code>PUT</code> request this means that the response body of a corresponding <code>200 OK</code> or <code>201 Created</code> response would have been identical to the request body, i.e. no server-side modification of values sent in the request body, no server-calculated values etc. For a <code>PATCH</code> request this means that the response body of a corresponding <code>200 OK</code> or <code>201 Created</code> response would have consisted of all values sent in the request body, plus (for values not sent in the request body) server-side values corresponding to the <code>ETag</code> value sent in the <code>If-Match</code> header of the <code>PATCH</code> request, i.e. the previous values “known” to the client.</p>
</details>
<details open><summary>
Expand Down
14 changes: 12 additions & 2 deletions docs/odata-protocol/odata-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -1826,9 +1826,19 @@ Requests](#AsynchronousBatchRequests).
### <a id="ResponseCode204NoContent" href="#ResponseCode204NoContent">9.1.4 Response Code `204 No Content`</a>

A request returns `204 No Content` if the requested resource has the
`null` value, or if the service applies a
`null` value and carries no control information [OData-JSON, section 4.6](https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html#ControlInformation)
other than what the minimal metadata format [OData-JSON, section 3.1.1](https://docs.oasis-open.org/odata/odata-json-format/v4.02/odata-json-format-v4.02.html#metadataminimalodatametadataminimal)
demands and no [instance annotations](#VocabularyExtensibility).

If the requested resource has the `null` value but carries additional control information
or instance annotations, the request returns [`200 OK`](#ResponseCode200OK) instead but
omits the [context URL](#ContextURL) from the representation of the response,
which then consists of the other control information and instance annotations only.

A request always returns `204 No Content` if the service applies a
[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) preference.
In this case, the response body MUST be empty.

With response code `204`, the response body MUST be empty.

As defined in [RFC9110](#rfc9110), a [Data Modification
Request](#DataModification) that responds with
Expand Down
6 changes: 3 additions & 3 deletions odata-json-format/10 Media Entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ A single-valued property or operation response that has the
[OData-Protocol](#ODataProtocol).

A property or operation response that is of a primitive type is
represented as an object with a single name/value pair, whose name is
represented as an object with a name/value pair whose name is
Copy link
Contributor Author

@HeikoTheissen HeikoTheissen Oct 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted "single", because the JSON object can also contain control information and instance annotations (as demonstrated by example 26).

`value` and whose value is a [primitive
value](#PrimitiveValue).
value](#PrimitiveValue) or `null`.

A property or operation response that is of complex type is represented
as a [complex value](#ComplexValue).

A property or operation response that is of a collection type is
represented as an object with a single name/value pair whose name is
represented as an object with a name/value pair whose name is
`value`. Its value is the JSON representation of a
[collection of complex type values](#CollectionofComplexValues) or
[collection of primitive values](#CollectionofPrimitiveValues).
Expand Down
14 changes: 12 additions & 2 deletions odata-protocol/8 Header Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -930,9 +930,19 @@ Requests](#AsynchronousBatchRequests).
### ##subsubsec Response Code `204 No Content`

A request returns `204 No Content` if the requested resource has the
`null` value, or if the service applies a
`null` value and carries no control information [#OData-JSON#ControlInformation]
other than what the minimal metadata format [#OData-JSON#metadataminimalodatametadataminimal]
demands and no [instance annotations](#VocabularyExtensibility).

If the requested resource has the `null` value but carries additional control information
or instance annotations, the request returns [`200 OK`](#ResponseCode200OK) instead but
omits the [context URL](#ContextURL) from the representation of the response,
which then consists of the other control information and instance annotations only.

A request always returns `204 No Content` if the service applies a
[`return=minimal`](#Preferencereturnrepresentationandreturnminimal) preference.
In this case, the response body MUST be empty.

With response code `204`, the response body MUST be empty.

As defined in [RFC9110](#rfc9110), a [Data Modification
Request](#DataModification) that responds with
Expand Down