[teiid-issues] [JBoss JIRA] (TEIID-3686) OData DELETE nonexisting row - wrong response code

Van Halbert (JIRA) issues at jboss.org
Mon Jun 20 08:15:00 EDT 2016


     [ https://issues.jboss.org/browse/TEIID-3686?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Van Halbert reopened TEIID-3686:
--------------------------------


Setting this to ASSIGNED.

- OData V2 still returns 200 (OK) for first and second delete call. 
- OData v4 returns 204 (No Content) for first call and 304 (Not Modified) for second call. 
 -- The question is, whether this is good or not. Requirements from the description says, that response should be 404 [1]. It may seem that 304 is right, but user specifies URL of the resource which does not exist, and therefore OData service should return 404 (Not found) [1].

My conclusion:
- BZ is not fixed in OData V2 at all.
- BZ is fixed in OData V4 only partially.


[1] However, reporter did not provide any relevant document/specification which supports this assumption.
[2] This is relevant to any HTTP method, not only GET. http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398258

> OData DELETE nonexisting row - wrong response code
> --------------------------------------------------
>
>                 Key: TEIID-3686
>                 URL: https://issues.jboss.org/browse/TEIID-3686
>             Project: Teiid
>          Issue Type: Bug
>          Components: OData
>    Affects Versions: 8.7.1.6_2
>            Reporter: Michal Sanitrak
>            Assignee: Ramesh Reddy
>              Labels: CR1
>             Fix For: 8.12, 8.7.2.6_2
>
>
> I deployed VDB that can be accessed with OData. When I perform DELETE request to remove row for first time response code is 200 OK (maybe it should be 204) but when I repeat the same DELETE request and tried to delete already deleted entry, response is again 200 OK, but it should be 404 Not Found. Same thing happens even I when tried to delete entry with id that doesn't exist at all.
> Only indication of this problem is in the server log:
> {code:plain}INFO  [org.teiid.ODATA] (http-/127.0.0.1:8080-1) no entity to delete in =  BooksMySQL.BOOKS  with key= ('1')
> {code}
> I think that response code for deleting row that doesn't exist should be different than 200 OK.
> For example the service at odata.org returns following content with response code 404 Not Found:
> {code:xml}
> <?xml version="1.0" encoding="utf-8" standalone="yes"?>
> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
>     <code></code>
>     <message xml:lang="en-US">Resource not found for the segment 'Products'.</message>
> </error>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the teiid-issues mailing list