Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-316

Services select a default set of properties in absence of $select

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_WD01
    • Fix Version/s: V4.0_WD01
    • Component/s: Protocol
    • Labels:
      None
    • Environment:

      [Applied]

      Description

      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.

        Attachments

          Activity

          ralfhandl Ralf Handl created issue -
          ralfhandl Ralf Handl made changes -
          Field Original Value New Value
          Status New [ 10000 ] Open [ 1 ]
          Hide
          mikep Michael Pizzo (Inactive) added a comment - - edited

          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.

          Show
          mikep Michael Pizzo (Inactive) added a comment - - edited 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.
          Hide
          ralfhandl Ralf Handl added a comment -

          I don't want to loosen the contract that not specifying $select means "give me everything".

          I do want to reduce the difference in representatino between structural and navigation properties.

          Navigation properties are already omitted in JSON if their value can be calculated by the client from defaults, and we could do the same for structural properties, making minimal JSON even more minimalistic.

          This ticket only affects the JSON format.

          Show
          ralfhandl Ralf Handl added a comment - I don't want to loosen the contract that not specifying $select means "give me everything". I do want to reduce the difference in representatino between structural and navigation properties. Navigation properties are already omitted in JSON if their value can be calculated by the client from defaults, and we could do the same for structural properties, making minimal JSON even more minimalistic. This ticket only affects the JSON format.
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          I think there's an important difference between structural and navigation properties. Today even a simple client can materialize an entity without needing to understand/generate any markup. We lose that if we require that simple client to know about metadata and default values.

          If we were to do this I would want it something that the client had to opt into, separately from opting into minimal metadata (which, as the name implies, should just be "markup", not data). However, I really think the bits we'd be saving are unlikely to be worth the added complexity of adding another preference or format parameter – the format parameters for json are already complex enough, and asking for different combinations doesn't scale well as the matrix of options expands.

          Show
          mikep Michael Pizzo (Inactive) added a comment - I think there's an important difference between structural and navigation properties. Today even a simple client can materialize an entity without needing to understand/generate any markup. We lose that if we require that simple client to know about metadata and default values. If we were to do this I would want it something that the client had to opt into, separately from opting into minimal metadata (which, as the name implies, should just be "markup", not data). However, I really think the bits we'd be saving are unlikely to be worth the added complexity of adding another preference or format parameter – the format parameters for json are already complex enough, and asking for different combinations doesn't scale well as the matrix of options expands.
          Hide
          ralfhandl Ralf Handl added a comment -

          Ok, I see your point, proposal adapted.

          Show
          ralfhandl Ralf Handl added a comment - Ok, I see your point, proposal adapted.
          ralfhandl Ralf Handl made changes -
          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.
          ralfhandl Ralf Handl made changes -
          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
          mikep Michael Pizzo (Inactive) made changes -
          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
          ralfhandl Ralf Handl made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          ralfhandl Ralf Handl made changes -
          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
          ralfhandl Ralf Handl made changes -
          Assignee Ralf Handl [ ralfhandl ]
          Environment [Proposed] [Applying]
          ralfhandl Ralf Handl made changes -
          Environment [Applying] [Applied]
          Hide
          ralfhandl Ralf Handl added a comment -

          Added restriction that service MUST include key properties

          Show
          ralfhandl Ralf Handl added a comment - Added restriction that service MUST include key properties
          ralfhandl Ralf Handl made changes -
          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
          ralfhandl Ralf Handl made changes -
          Component/s OData Protocol [ 10267 ]
          Component/s OData JSON Format [ 10272 ]
          Environment [Applied] [Applying]
          ralfhandl Ralf Handl made changes -
          Environment [Applying] [Applied]
          Hide
          ralfhandl Ralf Handl added a comment -

          Accepted on 2013-06-20

          Show
          ralfhandl Ralf Handl added a comment - Accepted on 2013-06-20
          ralfhandl Ralf Handl made changes -
          Status Applied [ 10002 ] Closed [ 6 ]
          handl Ralf Handl made changes -
          Reporter Ralf Handl [ ralfhandl ] Ralf Handl [ handl ]
          handl Ralf Handl made changes -
          Assignee Ralf Handl [ ralfhandl ] Ralf Handl [ handl ]

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              handl Ralf Handl
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: