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

Transient entities in JSON #1942

Merged
merged 17 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 @@ -582,9 +582,9 @@ <h3 id="458-control-information-id-odataid"><a name="ControlInformationidodataid
<li>percent-encoding normalization as defined in section 6 of <a href="#rfc3986">RFC3986</a>.</li>
</ul>
<p>Note that the entity-id MUST be invariant across languages, so if key values are language dependent then the <code>id</code> MUST be included if it does not match convention for the localized key values. If the <code>id</code> is represented, it MAY be a <a href="#RelativeURLs">relative URL</a>.</p>
<p>If the entity is transient (i.e. cannot be read or updated), the <code>id</code> control information MUST appear in OData 4.0 payloads and have the <code>null</code> value. In 4.01 payloads transient entities need not have the <code>id</code> control information, and 4.01 clients MUST treat entities with neither <code>id</code> control information nor a full set of key properties as transient entities.</p>
<p>If the entity is transient (i.e. cannot be read or updated), the <code>id</code> control information MUST appear in OData 4.0 payloads and have the <code>null</code> value. In 4.01 payloads transient entities need not have the <code>id</code> control information, and 4.01 clients MUST treat entities with neither <code>id</code> control information nor a full set of key properties as transient entities. Services MAY use a string value following the pattern <code>odata:transient:{some-generated-identifier-unique-within-the-response}</code> instead of <code>null</code>, for example if they need to solve circular dependencies between transient entities by injecting an entity reference.</p>
<p>Entities with <code>id</code> equal to <code>null</code> cannot be updated or compared to other entities. If <a href="#metadataminimalodatametadataminimal"><code>metadata=minimal</code></a> is specified and the <code>id</code> is not present in the entity, then the canonical URL MUST be used as the entity-id.</p>
<p>The <code>id</code> control information MUST NOT appear for a collection. Its meaning in this context is reserved for future versions of this specification.</p>
<p>Entities with <code>id</code> equal to <code>null</code> cannot be compared to other entities, reread, or updated. If <a href="#metadataminimalodatametadataminimal"><code>metadata=minimal</code></a> is specified and the <code>id</code> is not present in the entity, then the canonical URL MUST be used as the entity-id.</p>
<h3 id="459-control-information-editlink-and-readlink-odataeditlink-and-odatareadlink"><a name="ControlInformationeditLinkandreadLinkodataeditLinkandodatareadLink" href="#ControlInformationeditLinkandreadLinkodataeditLinkandodatareadLink">4.5.9 Control Information: <code>editLink</code> and <code>readLink</code> (<code>odata.editLink</code> and <code>odata.readLink</code>)</a></h3>
<p>The <code>editLink</code> control information contains the edit URL of the entity; see <a href="#ODataProtocol">OData-Protocol</a>.</p>
<p>The <code>readLink</code> control information contains the read URL of the entity or collection; see <a href="#ODataProtocol">OData-Protocol</a>.</p>
Expand Down
13 changes: 7 additions & 6 deletions docs/odata-json-format/odata-json-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -964,17 +964,18 @@ and have the `null` value. In 4.01 payloads transient
entities need not have the `id` control information, and 4.01
clients MUST treat entities with neither `id` control
information nor a full set of key properties as transient entities.

The `id` control information MUST NOT appear for a
collection. Its meaning in this context is reserved for future versions
of this specification.
Services MAY use a string value following the pattern `odata:transient:{some-generated-identifier-unique-within-the-response}` instead of `null`, for example if they need to solve circular dependencies between transient entities by injecting an entity reference.

Entities with `id` equal to `null` cannot be
compared to other entities, reread, or updated. If
[`metadata=minimal`](#metadataminimalodatametadataminimal)
updated or compared to other entities.
If [`metadata=minimal`](#metadataminimalodatametadataminimal)
is specified and the `id` is not present in the entity, then
the canonical URL MUST be used as the entity-id.

The `id` control information MUST NOT appear for a
collection. Its meaning in this context is reserved for future versions
of this specification.

### <a name="ControlInformationeditLinkandreadLinkodataeditLinkandodatareadLink" href="#ControlInformationeditLinkandreadLinkodataeditLinkandodatareadLink">4.5.9 Control Information: `editLink` and `readLink` (`odata.editLink` and `odata.readLink`)</a>

The `editLink` control information contains
Expand Down
13 changes: 7 additions & 6 deletions odata-json-format/4 Common Characteristics.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,17 +423,18 @@ and have the `null` value. In 4.01 payloads transient
entities need not have the `id` control information, and 4.01
clients MUST treat entities with neither `id` control
ralfhandl marked this conversation as resolved.
Show resolved Hide resolved
information nor a full set of key properties as transient entities.

The `id` control information MUST NOT appear for a
collection. Its meaning in this context is reserved for future versions
of this specification.
Services MAY use a string value following the pattern `odata:transient:{some-generated-identifier-unique-within-the-response}` instead of `null`, for example if they need to solve circular dependencies between transient entities by injecting an entity reference.

Entities with `id` equal to `null` cannot be
ralfhandl marked this conversation as resolved.
Show resolved Hide resolved
compared to other entities, reread, or updated. If
[`metadata=minimal`](#metadataminimalodatametadataminimal)
updated or compared to other entities.
If [`metadata=minimal`](#metadataminimalodatametadataminimal)
is specified and the `id` is not present in the entity, then
the canonical URL MUST be used as the entity-id.
ralfhandl marked this conversation as resolved.
Show resolved Hide resolved

The `id` control information MUST NOT appear for a
collection. Its meaning in this context is reserved for future versions
of this specification.

### ##subsubsec Control Information: `editLink` and `readLink` (`odata.editLink` and `odata.readLink`)

The `editLink` control information contains
Expand Down