Properties not present in a request payload are already interpreted as having the default value (if defined in $metadata) or the null value (if nullable and without default value).
Why not allow the same for responses.
Field | Original Value | New Value |
---|---|---|
Status | New [ 10000 ] | Open [ 1 ] |
Proposal | Services MAY omit properties from responses if they have the default value defined in $metadata, or null value if nullable and without default value in responses to requests with odata.metadata=minimal or none. | Services MUST NOT omit structural properties from responses unless asked to do so via $select. |
Proposal | Services MUST NOT omit structural properties from responses unless asked to do so via $select. | See summary |
Summary | Allow omitting properties with null or default values from responses | Services MUST NOT omit structural properties from responses unless asked to do so via $select |
Proposal | See summary |
Clients can explicitly select a set of properties through $select, and can specify $select=* for all structural properties. Services must return all selected properties and can return other non-selected properties. In the absence of a select, the service returns a default set of properties. Any time the service returns less than the full set of properties (either because the client specified a select or because the service returned a subset of properties in the absence of a select) the metadata url must reflect the set of selected properties. If a select is present in a metadata url, it must include all expanded navigation properties. |
Summary | Services MUST NOT omit structural properties from responses unless asked to do so via $select | Services select a default set of properties in absence of $select |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Proposal |
Clients can explicitly select a set of properties through $select, and can specify $select=* for all structural properties. Services must return all selected properties and can return other non-selected properties. In the absence of a select, the service returns a default set of properties. Any time the service returns less than the full set of properties (either because the client specified a select or because the service returned a subset of properties in the absence of a select) the metadata url must reflect the set of selected properties. If a select is present in a metadata url, it must include all expanded navigation properties. |
Clients can explicitly select a set of properties through $select, and can specify $select=* for all structural properties. Services must return all selected properties and can return other non-selected properties. In the absence of a select, the service returns a default set of properties. Any time the service returns less than the full set of properties (either because the client specified a select or because the service returned a subset of properties in the absence of a select) the metadata url must reflect the set of selected properties. If a select is present in a metadata url, it must include all expanded navigation properties. Accepted: https://www.oasis-open.org/committees/download.php/49447/odata-meeting-40_on-20130606-minutes.html#odata-316 |
Assignee | Ralf Handl [ ralfhandl ] | |
Environment | [Proposed] | [Applying] |
Environment | [Applying] | [Applied] |
Proposal |
Clients can explicitly select a set of properties through $select, and can specify $select=* for all structural properties. Services must return all selected properties and can return other non-selected properties. In the absence of a select, the service returns a default set of properties. Any time the service returns less than the full set of properties (either because the client specified a select or because the service returned a subset of properties in the absence of a select) the metadata url must reflect the set of selected properties. If a select is present in a metadata url, it must include all expanded navigation properties. Accepted: https://www.oasis-open.org/committees/download.php/49447/odata-meeting-40_on-20130606-minutes.html#odata-316 |
Clients can explicitly select a set of properties through $select, and can specify $select=* for all structural properties. Services must return all selected properties and can return other non-selected properties. In the absence of a select, the service returns a default set of properties that must include all key properties. Any time the service returns less than the full set of properties (either because the client specified a select or because the service returned a subset of properties in the absence of a select) the metadata url must reflect the set of selected properties. If a select is present in a metadata url, it must include all expanded navigation properties. Accepted: https://www.oasis-open.org/committees/download.php/49447/odata-meeting-40_on-20130606-minutes.html#odata-316 |
Component/s | OData Protocol [ 10267 ] | |
Component/s | OData JSON Format [ 10272 ] | |
Environment | [Applied] | [Applying] |
Environment | [Applying] | [Applied] |
Status | Applied [ 10002 ] | Closed [ 6 ] |
Reporter | Ralf Handl [ ralfhandl ] | Ralf Handl [ handl ] |
Assignee | Ralf Handl [ ralfhandl ] | Ralf Handl [ handl ] |
Assuming that the value of omitted properties is null or default values seems dangerous.
There may be multiple reasons that a service omits values; there may be permissions issues, certain properties may be expensive compute, etc.
We should say that, in the absence of $select, services may return a subset of properties defined in the $metadata. If $select is specified, each property must be returned or an error generated.
Client should never make assumptions about missing properties.