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

Consider deprecating structural casting

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_ERRATA03
    • Fix Version/s: V4.01_WD01
    • Component/s: URL Conventions
    • Labels:
      None
    • Environment:

      [Proposed]

      Description

      Section 5.1.1.8.1, cast, of [URL Conventions] currently says that the cast function can be used to cast to types outside of a type hierarchy using structural casting--whatever names (and types) match are cast to the new type:

      • Services MAY support structural casting of entities and complex type instances to a derived type, or arbitrary structured type, by assigning values of identically named properties and casting them recursively. The cast fails if one of the property-value casts fails or the target type contains non-nullable properties that have not been assigned a value.

      Minimally, we need to clarify that this only applies to the cast function and not appending a cast segment, i.e., to a collection, since we count on appending cast segments to filter the collection according to those types that are of the particular type.

      We could go one step further and deprecate the structural casting from the cast function as something that seemed like a safe enough thing at the time but turned out not to be a great idea.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikep Michael Pizzo (Inactive)
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: