Skip to content

Commit

Permalink
Describe returning a 200 response from a DELETE request (#1952)
Browse files Browse the repository at this point in the history
Fixes #380

---------

Co-authored-by: Ralf Handl <[email protected]>
  • Loading branch information
mikepizzo and ralfhandl authored Jun 19, 2024
1 parent 1dd5eb1 commit d68433f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/odata-protocol/odata-protocol.html
Original file line number Diff line number Diff line change
Expand Up @@ -2406,7 +2406,7 @@ <h3 id="1145-delete-an-entity"><a name="DeleteanEntity" href="#DeleteanEntity">1
</summary>
<p>To delete an individual entity, the client makes a <code>DELETE</code> request to a URL that identifies the entity. Services MAY restrict deletes only to requests addressing the <a href="#ReadURLsandEditURLs">edit URL</a> of the entity.</p>
<p>The request body SHOULD be empty. Top-level singleton entities can be deleted if they are nullable. Services supporting this MAY advertise it by annotating the singleton with the term <code>Capabilities.DeleteRestrictions</code> (nested property <code>Deletable</code> with value <code>true</code>) defined in <a href="#ODataVocCap">OData-VocCap</a>.</p>
<p>On successful completion of the delete, the response MUST be <a href="#ResponseCode204NoContent"><code>204 No Content</code></a> and contain an empty body.</p>
<p>On successful completion of the delete, the response MUST either be <a href="#ResponseCode204NoContent"><code>204 No Content</code></a> and contain an empty body, or <a href="#ResponseCode200OK"><code>200 OK</code></a> and contain a representation of a deleted entity according to the specified format.</p>
<p>Services MUST implicitly remove relations to and from an entity when deleting it; clients need not delete the relations explicitly.</p>
<p>Services MAY implicitly delete or modify related entities if required by <a href="#HandlingofIntegrityConstraints">integrity constraints</a>. If integrity constraints are declared in <code>$metadata</code> using a <code>ReferentialConstraint</code> element, services MUST modify affected related entities according to the declared integrity constraints, e.g. by deleting dependent entities, or setting dependent properties to <code>null</code> or their default value.</p>
<p>One such integrity constraint results from using a navigation property in a key definition of an entity type. If the related “key” entity is deleted, the dependent entity is also deleted.</p>
Expand Down
6 changes: 4 additions & 2 deletions docs/odata-protocol/odata-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -4582,8 +4582,10 @@ annotating the singleton with the term `Capabilities.DeleteRestrictions`
(nested property `Deletable` with value `true`) defined in
[OData-VocCap](#ODataVocCap).

On successful completion of the delete, the response MUST be
[`204 No Content`](#ResponseCode204NoContent) and contain an empty body.
On successful completion of the delete, the response MUST either be
[`204 No Content`](#ResponseCode204NoContent) and contain an empty body,
or [`200 OK`](#ResponseCode200OK) and contain a representation of a
deleted entity according to the specified format.

Services MUST implicitly remove relations to and from an entity when
deleting it; clients need not delete the relations explicitly.
Expand Down
6 changes: 4 additions & 2 deletions odata-protocol/11.4 Data Modification.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,10 @@ annotating the singleton with the term `Capabilities.DeleteRestrictions`
(nested property `Deletable` with value `true`) defined in
[OData-VocCap](#ODataVocCap).

On successful completion of the delete, the response MUST be
[`204 No Content`](#ResponseCode204NoContent) and contain an empty body.
On successful completion of the delete, the response MUST either be
[`204 No Content`](#ResponseCode204NoContent) and contain an empty body,
or [`200 OK`](#ResponseCode200OK) and contain a representation of a
deleted entity according to the specified format.

Services MUST implicitly remove relations to and from an entity when
deleting it; clients need not delete the relations explicitly.
Expand Down

0 comments on commit d68433f

Please sign in to comment.