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

$entity should require cast segment in order to apply $select/$expand

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_CS01
    • Fix Version/s: V4.0_CSD03
    • Component/s: ABNF, Protocol
    • Labels:
      None
    • Environment:

      [Applied]

      Description

      Given an opaque id for an entity, the client can get the instance using the new /$entity resource and providing the id through the $id query option, such as:

      http://host.service/$entity?$id=urn:mysvc5304-98001-7832-4425

      This can be cast to a particular type:

      http://host.service/$entity/myservice.Customer?$id=urn:mysvc5304-98001-7832-4425

      And any of the query options supported for a single resource can be applied:

      http://host.service/$entity/myservice.Customer?$id=urn:mysvc5304-98001-7832-4425?$select=LastName&$expand=Orders

      However the text current does no require the cast in order to apply $select and $expand. This is a bug, because without the cast a parser cannot determine whether the $select and $expand are valid without actually retrieving the object and discovering its type.

      Everywhere else we consistently require casting to the correct type in order to access members of that type.

      Also, I think there is a bug in the ABNF as it doesn't appear to allow for the cast segment:

      '$entity' "?" entityOptions

        Attachments

          Activity

            People

            • Assignee:
              mikep Michael Pizzo
              Reporter:
              mikep Michael Pizzo
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: