Validation errors for Delete Image API - Expected response codes not received
Bug #1006033 reported by
Rohit Karajgi
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tempest |
Fix Released
|
Undecided
|
Jay Pipes |
Bug Description
Our tempest tests fail for the following scenarios for Delete Image API validation:
1) Return an error while trying to delete an image with blank Image Id
2) Return an error while trying to delete an image with negative Image id
3) Return an error while trying to delete an image with Id having non hex characters (like '11a22b9-
For the above three scenarios:
Expected Error Code: 400 Bad Request
Actual Error Code: 404 NotFound
4) Return an error while trying to delete image with id over length limit (like '11a22b9-
Expected Error Code: 413 OverLimit
Actual Error Code: 400 BadRequest
affects: | nova → tempest |
Changed in tempest: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I tested the fourth scenario, it also returns "404 NotFound".
We can discuss which are the appropriate return code under these scenarios.
As to #1 and #2, I agree with you, "400 Bad Request" is better than "404 Not Found".
As to #3 and #4, I cannot agree with you. I don't find any naming rules of the image id. So any string can be an acceptable image id. I think "404 Not Found" is better in those situations.
"413 OverLimit" is a good choice. In HTTP status code definition, code 413 is defined as "Request Entity Too Large". It doesn't describe the situation correctly.