-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.01_CS01
-
Fix Version/s: V4.01_CS02
-
Component/s: Protocol
-
Labels:None
-
Environment:
Applied
-
Proposal:
-
Resolution:
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):
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.
And later, we say:
On success, the response MUST be a valid update response.
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?