Make $expand implicit if navigation properties are mentioned in $select

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Minor
    • V4.0_WD01
    • Affects Version/s: V4.0_WD01
    • Component/s: Protocol, URL Conventions
    • None
    • Environment:

      [Closed]

    • Hide

      I propose we keep $select and $expand separate.

      $expand and $select are different parts of the query, handled and evaluated at different points in time (similar to FROM and SELECT clauses in SQL).

      $expand is evaluated before $select and identifies the full set of entities available to the client. Once that full set of data is defined, $select allows the client to select the properties of those entities that are of interest from that set of data.

      We are looking at extending $expand to include things like filtering and sorting of the related entities. I would not like to introduce complexity by saying that $expand is used in some case (i.e., where filtering/sorting of related entities is required) but not used in other cases.

      Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47432/latest/odata-meeting-15_on-20121108_9-F2F-minutes.html

      Show
      I propose we keep $select and $expand separate. $expand and $select are different parts of the query, handled and evaluated at different points in time (similar to FROM and SELECT clauses in SQL). $expand is evaluated before $select and identifies the full set of entities available to the client. Once that full set of data is defined, $select allows the client to select the properties of those entities that are of interest from that set of data. We are looking at extending $expand to include things like filtering and sorting of the related entities. I would not like to introduce complexity by saying that $expand is used in some case (i.e., where filtering/sorting of related entities is required) but not used in other cases. Accepted: https://www.oasis-open.org/apps/org/workgroup/odata/download.php/47432/latest/odata-meeting-15_on-20121108_9-F2F-minutes.html

      Currently clients need to repeat themselves when projecting on expanded entities:

      GET http://services.odata.org/OData/OData.svc/Products?$select=*,Category/Name&$expand=Category

      This could be reduced to

      GET http://services.odata.org/OData/OData.svc/Products?$select=*,Category/Name

      because the client explicitly requests Category/Name, and the server can only satisfy that if it expands the Category.

            Assignee:
            handl
            Reporter:
            martinzurmuehl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: