Skip to content

Commit

Permalink
Place the additional text (mostly) in [OData-Protocol]
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoTheissen committed Oct 25, 2024
1 parent 944edea commit ebf3972
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 40 deletions.
26 changes: 3 additions & 23 deletions odata-json-format/10 Media Entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,16 @@ An individual property or operation response is represented as a JSON
object.

A single-valued property or operation response that has the
`null` value does not have a representation provided that, with
[minimal metadata](#metadataminimalodatametadataminimal), it carries no
[control information](#ControlInformation) other than
[`context`](#ControlInformationcontextodatacontext)
and no [instance annotations](#InstanceAnnotations); see [OData-Protocol](#ODataProtocol).
`null` value does not have a representation; see
[OData-Protocol](#ODataProtocol).

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

A property or operation response that is of complex type is represented
as a [complex value](#ComplexValue). If the value is `null`, the context control information
is omitted and the JSON object consists of name/value pairs for the
other control information and instance annotations only.
as a [complex value](#ComplexValue).

A property or operation response that is of a collection type is
represented as an object with a name/value pair whose name is
Expand Down Expand Up @@ -109,21 +104,6 @@ Example ##ex: empty collection of complex values
```
:::

::: example
Example ##ex: An action is invoked when a utilities customer moves into a building,
it returns the address. After a successful move-in it might return the
`null` value accompanied by an instance annotation:
```json
{
"@Core.Messages": [{
"code": "EADDRESS",
"message": "Street name not yet determined",
"severity": "error"
}]
}
```
:::

Note: the context URL is optional in requests.

-------
Expand Down
16 changes: 1 addition & 15 deletions odata-json-format/5 Service Document.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,7 @@ An entity is serialized as a JSON object. It MAY contain
or [`deltaLink`](#ControlInformationdeltaLinkodatadeltaLink)
control information.

If a nullable single-valued navigation property or
entity-valued annotation or return type of an operation has the `null` value,
the value is serialized as follows:
- If, with [minimal metadata](#metadataminimalodatametadataminimal),
the value carries no [control information](#ControlInformation) other than
[`context`](#ControlInformationcontextodatacontext)
and no [instance annotations](#InstanceAnnotations),
- the value does not have a representation as response to a request (see [#OData-Protocol#ResponseCode204NoContent])
- but is represented by the JSON literal `null` when it occurs in a name/value pair
in another JSON object (for example, an [expanded single-valued navigation property](#ExpandedNavigationProperty)).
- Otherwise the context control information is omitted and the serialization produces
a JSON object consisting of name/value pairs for the
other control information and instance annotations only.

Otherwise, each [property](#StructuralProperty) to be transmitted is
Each [property](#StructuralProperty) to be transmitted is
represented as a name/value pair within the object. The order properties
appear within the object is considered insignificant.

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]
requires and no [instance annotations](#VocabularyExtensibility).

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

In these cases, the response body MUST be empty.

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.

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

0 comments on commit ebf3972

Please sign in to comment.