OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-1236) What should be returned for inserted non-entity value?


Michael Pizzo created ODATA-1236:
------------------------------------

             Summary: What should be returned for inserted non-entity value?
                 Key: ODATA-1236
                 URL: https://issues.oasis-open.org/browse/ODATA-1236
             Project: OASIS Open Data Protocol (OData) TC
          Issue Type: Bug
          Components: Protocol
    Affects Versions: V4.01_CS01
         Environment: Proposed
            Reporter: Michael Pizzo
             Fix For: V4.01_CS02


In ODATA-616 we introduced the ability to post to a collection of non-entity types.  The new wording appears in [Section 11.4.9.4, Update a Collection Property, of Protocol](http://docs.oasis-open.org/odata/odata/v4.01/cs01/part1-protocol/odata-v4.01-cs01-part1-protocol.html#_Toc505771257):

{panel}
A successful POST request to the edit URL of a collection property adds an item to the collection. The body of the request MUST be a single item to be added to the collection. If the collection is ordered, the item is added to the end of the collection, and $index MAY be used to specify a zero-based ordinal position to insert the new value, with a negative value indicating an ordinal position from the end of the collection.
{panel}

And later, we say:
{panel}
    On success, the response MUST be a valid update response.
{panel}

However, we don't say *what* response code, or body, to return for this case.

For a created entity, we would typically return 201 Created and the newly created resource in the body, unless the return=minimal preference was applied, in which case we would return 204.  But 201 Created requires a Location header (and, in OData, an Entity-id header). So, if we return 201, what would we return for the location (and entity-id) headers?

Does it matter whether the collection is ordered (in which case we have a location for the added resource)?

Or, perhaps we always return 204, no content (and no body)?

Or do we view this as an update and return 200, along with the newly inserted value? Or 200 with the full collection? Or 200 with the entity containing (at least?) the populated collection?



--
This message was sent by Atlassian JIRA
(v7.7.2#77003)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]