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

Clarify whether server-generated properties can be omitted in POST, even if they are not nullable

    XMLWordPrintable

    Details

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

      [Applied]

    • Proposal:
      Hide

      Protocol section "11.5.2.2 Create Related Entities When Creating an Entity" states

      "Properties computed by the service, along with properties of related entities that are tied to key properties of the principal entity by a referential constraint, MAY be omitted from the request. If the inline representation contains a value for a computed or dependent property, the service MUST ignore that value when creating the related entity."

      Split that statement and move the "computed" part to the enclosing section "11.5.2 Create an Entity" because it is true in general.

      Simplify the term StoreGeneratedPattern in the Core vocabulary and split it into two tagging terms with more intuitive names:

      <Term Name="Computed" Type="Core.Tag" DefaultValue="true" AppliesTo="Property" />
      <Term Name="Immutable" Type="Core.Tag" DefaultValue="true" AppliesTo="Property" />

      Refer to these terms in Protocol as a means for clients to find out which properties are computed by the service.

      Accepted: https://www.oasis-open.org/committees/download.php/49125/odata-meeting-36_on-20130509-minutes.html#odata-366

      Show
      Protocol section "11.5.2.2 Create Related Entities When Creating an Entity" states "Properties computed by the service, along with properties of related entities that are tied to key properties of the principal entity by a referential constraint, MAY be omitted from the request. If the inline representation contains a value for a computed or dependent property, the service MUST ignore that value when creating the related entity." Split that statement and move the "computed" part to the enclosing section "11.5.2 Create an Entity" because it is true in general. Simplify the term StoreGeneratedPattern in the Core vocabulary and split it into two tagging terms with more intuitive names: <Term Name="Computed" Type="Core.Tag" DefaultValue="true" AppliesTo="Property" /> <Term Name="Immutable" Type="Core.Tag" DefaultValue="true" AppliesTo="Property" /> Refer to these terms in Protocol as a means for clients to find out which properties are computed by the service. Accepted: https://www.oasis-open.org/committees/download.php/49125/odata-meeting-36_on-20130509-minutes.html#odata-366
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/49206/odata-v4.0-wd02-part1-protocol-2013-05-16.docx https://tools.oasis-open.org/version-control/browse/wsvn/odata/trunk/spec/vocabularies/Org.OData.Core.V1.xml?rev=295 Accepted: https://www.oasis-open.org/committees/download.php/49557/odata-meeting-41_on-20130613_14-F2F-minutes.html#odata-366

      Description

      It is conventional to define primary key properties (and other properties such as "creationTime") as non-nullable.

      However if properties (such as primary keys) are server-generated, the client cannot provide an appropriate initial value in POST.

      The spec appears to be silent on this issue.

      What should be done?

      (1) Define the properties as nullable, and require the client to pass null values on POST.

      (2) Define the properties as nullable, and allow the client to omit them from the payload (even for a "complete" entity) on POST.

      (3) Define the properties as non-nullable, and require the client to pass junk values on POST.

      (4) Define the properties as non-nullable, and allow the client to omit them from the payload (even for a "complete" entity) on POST.

      It might help to understand what variations are supported (or "intended" to be supported) by OData V1-V3 in this respect, before we proceed to make a poposal for V4.

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              evan.ireland.2 Evan Ireland
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: