qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Wall (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QPID-7125) [Java Broker] REST API return code when deleting a resource which does not exist
Date Mon, 18 Sep 2017 12:54:00 GMT

    [ https://issues.apache.org/jira/browse/QPID-7125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16169966#comment-16169966
] 

Keith Wall commented on QPID-7125:
----------------------------------

When referring to an object using a fully qualified URI to the object i.e. DELETE /api/latest/queue/myvhn/myvh/myqueue
that REST API return 200 and an response if the object was found and deleted and a 404 if
the object is not found.    This applies to 6.0, 6.1 and 7.0 (master today).

When deleting using the a filter , e.g. DELETE /api/latest/queue/myvhn/myvh?name=myqueue the
current behaviour is that 200 is returned with empty response even if the filter matches nothing.
 This was Julien's original complaint.  The user is unable to tell how many objects are deleted.
 This behaviour has not changed since 6.0.    I think to be consistent, if DELETing with a
filter, then the response from the DELETE should be a list containing the objects that were
deleted.  If the filter matched nothing, the result would be an empty list.  This would be
consistent with GET.

I don't think this is sufficiently impactful to hold up 7.0, so I am descoping from the v7
release.


> [Java Broker] REST API return code when deleting a resource which does not exist
> --------------------------------------------------------------------------------
>
>                 Key: QPID-7125
>                 URL: https://issues.apache.org/jira/browse/QPID-7125
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>            Reporter: Rob Godfrey
>            Priority: Minor
>             Fix For: Future
>
>
> From this mail: http://qpid.2158936.n2.nabble.com/potential-java-broker-REST-API-bug-tp7639681.html

> {quote}
> A DELETE request, if not resulting in an error, will always return HTTP status 200 and
no body content, no matter if a queue with that name exists or not
> {quote}
> There seem to be a number of views on the correct behaviour here in REST APIs, based
somewhat on how one interprets the notion of idempotence.
> See for example http://stackoverflow.com/questions/23486992/rest-api-proper-http-status-code-for-invalid-delete
 and http://stackoverflow.com/questions/6439416/deleting-a-resource-using-http-delete 
> http://www.restapitutorial.com/lessons/httpmethods.html suggests 404 for such a case,
but also points mentions how 204 (empty body) and 200 (which maybe should return the representation
of the deleted entity) can be used in the non failure case



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


Mime
View raw message