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

Clarify if a PUT request is allowed to change the odata.type of the entity (public comment c201403e00002)

    XMLWordPrintable

    Details

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

      [Applied]

    • Proposal:
      Hide

      Clarify that PUT requests cannot change the type. A PUT request affects all structural properties of the entity, but things like identity, type, and relationships are not affected by the PUT.

      This is supported by the current wording but could be spelled out more clearly:

      PUT MUST replace all values of structural properties with those specified in the request body. Missing non-key, updatable structural properties not defined as dependent properties within a referential constraint MUST be set to their default values. Missing dynamic structural properties MUST be removed or set to null.

      Accepted: https://www.oasis-open.org/committees/download.php/52767/odata-meeting-70_on-20140403-minutes.html#odata-635

      Show
      Clarify that PUT requests cannot change the type. A PUT request affects all structural properties of the entity, but things like identity, type, and relationships are not affected by the PUT. This is supported by the current wording but could be spelled out more clearly: PUT MUST replace all values of structural properties with those specified in the request body. Missing non-key, updatable structural properties not defined as dependent properties within a referential constraint MUST be set to their default values. Missing dynamic structural properties MUST be removed or set to null. Accepted: https://www.oasis-open.org/committees/download.php/52767/odata-meeting-70_on-20140403-minutes.html#odata-635

      Description

      We received the public Comment #20140300002 on 2014-03-27 with title "Non-updatable properties?".

      Text was:
      """
      From
      http://docs.oasis-open.org/odata/odata/v4.0/os/part1-protocol/odata-v4.0-os-part1-protocol.html#_Toc372793719,
      section 11.4.3 Update An Entity

      “Key and other non-updatable properties, as well as dependent properties
      that are not tied to key properties of the principal entity, can be
      omitted from the request. If the request contains a value for one of
      these properties, the service MUST ignore that value when applying the
      update.”

      Is there a definition of what “other non-updatable properties” means
      elsewhere in the spec? I haven’t had much success finding a reference.

      I’m trying to understand this section of the spec to answer a specific
      use case:

      Is a PUT request allowed to change the odata.type of the entity?

      Clearly this is not allowed by PATCH and MERGE because they operate on
      the original object, but for PUT I’m not sure. I would like to say no,
      the entity type should not be altered in any kind of update, but since
      PUT requires complete replacement of the original entity, constructing a
      different type in its place is not beyond the realm of possibility.

      Are there OData implementations that allow changing the type of an
      entity in a PUT?

      Thoughts?
      """

        Attachments

          Activity

            People

            • Assignee:
              hubert.heijkers Hubert Heijkers (Inactive)
              Reporter:
              sdrees Stefan Drees (Inactive)
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: