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

Data Modification Request succeeds, but response body cannot be created

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: V4.01_ERRATA01
    • Component/s: Protocol
    • Labels:
      None
    • Proposal:
      Hide

      OData-Protocol, section 11.4.2:

      Upon successful creation of the entity, the service MUST respond with either 201 Created and a representation of the created entity, or 204 No Content if the request included a Prefer header with a value of return=minimal and did not include the system query options $select and $expand, or if a representation of the created entity could not be constructed. In either case, the response MUST contain a Location header that contains the edit URL or read URL of the created entity. 

       

      OData-Protocol, section 11.4.3:

      Upon successful completion of the update, the service responds with either 200 OK and a representation of the updated entity, or 204 No Content, for example, if the request did not specify a Prefer Header with a value of return=representation and did not include the system query options $select and $expand, or if a representation of the updated entity could not be constructed.

      Show
      OData-Protocol, section 11.4.2: Upon successful creation of the entity, the service MUST respond with either  201 Created  and a representation of the created entity, or  204 No Content  if the request included a Prefer header with a value of  return=minimal  and did not include the system query options  $select  and  $expand, or if a representation of the created entity could not be constructed . In either case, the response MUST contain a  Location  header that contains the edit URL or read URL of the created entity.    OData-Protocol, section 11.4.3: Upon successful completion of the update, the service responds with either 200 OK and a representation of the updated entity, or 204 No Content, for example, if the request did not specify a Prefer Header with a value of return=representation and did not include the system query options $select and $expand, or if a representation of the updated entity could not be constructed .
    • Resolution:
      Show
      https://github.com/oasis-tcs/odata-specs/pull/212

      Description

      Consider a data modification request that requires a response body (for example, creation with Prefer: return=representation or $expand). Imagine that the data change is committed to the database, but the subsequent database SELECT statement fails for some reason.

      How shall the server respond to indicate that the data are changed on the database, yet there is no response body?

      • 204 No Content plus Location header after an entity creation
      • 204 No Content without Preference-Applied: representation header after an update with Prefer: return=representation

        Attachments

          Activity

            People

            • Assignee:
              heiko.theissen Heiko Theissen
              Reporter:
              heiko.theissen Heiko Theissen
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: