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

Mismatch between 11.2.6 Requesting Related Entities and 11.2.7 Requesting Entity References

    XMLWordPrintable

    Details

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

      Applied

    • Proposal:
      Hide

      Define:
      1) /entity(exist)/null_nav_prop/$value – 404 (for nav to media entity)
      2) /entity(exist)/null_structuralmedia_prop - 204
      3) non_media_entity/$value is a bad request (i.e., 400)
      4) specify that some services may return 204 for /entity(exist)/null_nav_prop/$ref (and that we expect that to be the preferred response in 4.01). Therefore, clients should be prepared to receive either 204 or 404 for this condition.
      5) in 4.01, make 204 the preferred response for 4.01 clients.

      Show
      Define: 1) /entity(exist)/null_nav_prop/$value – 404 (for nav to media entity) 2) /entity(exist)/null_structuralmedia_prop - 204 3) non_media_entity/$value is a bad request (i.e., 400) 4) specify that some services may return 204 for /entity(exist)/null_nav_prop/$ref (and that we expect that to be the preferred response in 4.01). Therefore, clients should be prepared to receive either 204 or 404 for this condition. 5) in 4.01, make 204 the preferred response for 4.01 clients.
    • Resolution:
      Hide

      1) /entity(exist)/null_nav_prop/$value – 404 (for nav to media entity)
      =>Created Section 11.2.3, Requesting the Media Stream of a Media Entry and added rules around /$value of a null entity.

      2) /entity(exist)/null_structuralmedia_prop - 204
      =>already defined for any single valued property in 11.2.3. and 11.4.8.2

      3) non_media_entity/$value is a bad request (i.e., 400)
      ==>Added to new section 11.2.3

      4) specify that some services may return 204 for /entity(exist)/null_nav_prop/$ref (and that we expect that to be the preferred response in 4.01). Therefore, clients should be prepared to receive either 204 or 404 for this condition.
      =>Applied to 11.2.7

      https://www.oasis-open.org/committees/download.php/57689/odata-v4.0-wd08-part1-protocol-2016-03-03.docx

      Show
      1) /entity(exist)/null_nav_prop/$value – 404 (for nav to media entity) =>Created Section 11.2.3, Requesting the Media Stream of a Media Entry and added rules around /$value of a null entity. 2) /entity(exist)/null_structuralmedia_prop - 204 =>already defined for any single valued property in 11.2.3. and 11.4.8.2 3) non_media_entity/$value is a bad request (i.e., 400) ==>Added to new section 11.2.3 4) specify that some services may return 204 for /entity(exist)/null_nav_prop/$ref (and that we expect that to be the preferred response in 4.01). Therefore, clients should be prepared to receive either 204 or 404 for this condition. =>Applied to 11.2.7 https://www.oasis-open.org/committees/download.php/57689/odata-v4.0-wd08-part1-protocol-2016-03-03.docx

      Description

      11.2.6 defines that requests to nullable single-valued navigation properties return 204 No Content if no entity is currently related.

      11.2.7 defines that all requests for references to a single entity return 404 Not Found, not distinguishing between "direct" resource paths and resource paths to related entities.

      This leads to:

      GET Employees('TheBigBoss')/Manager --> 204 No Content
      GET Employees('TheBigBoss')/Manager/$ref --> 404 Not Found

      Clarify whether this is intentional:
      A) Of course, the related Manager is empty, so the reference does not exist, or
      B) Ooops, of course both requests should return the same response code because /$ref is just a briefer representation of the non-existing related entity

      Also clarify what happens if other path segments are added, e.g. properties or navigation properties:

      GET Employees('TheBigBoss')/Manager/Name --> ???
      GET Employees('TheBigBoss')/Manager/Department --> ???

        Attachments

          Activity

            People

            • Assignee:
              mikep Michael Pizzo
              Reporter:
              handl Ralf Handl
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: