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

          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.
          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
          Hide
          ralfhandl Ralf Handl added a comment -

          Accepted on 2013-06-20

          Show
          ralfhandl Ralf Handl added a comment - Accepted on 2013-06-20

            People

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

              Dates

              • Created:
                Updated:
                Resolved: