Description of problem: When deleting nonexistent /api/authentication/:id using POST, the response is { "success": false, "message": "Couldn't find Authentication with 'id'=:id" } and the HTTP status is 200 (success) When deleting nonexistent authentication using the DELETE HTTP method, the response is empty and and the HTTP status is 204 (success). The responses are inconsistent with responses from other collections where the "ActiveRecord::RecordNotFound" error is returned and the HTTP status is 404 (not found). E.g. deleting nonexistent VM: { "error": { "kind": "not_found", "message": "Couldn't find Vm with 'id'=199999 ...", "klass": "ActiveRecord::RecordNotFound" } } HTTP status 404 Version-Release number of selected component (if applicable): 5.8.1.5 How reproducible: very Steps to Reproduce: 1. POST https://<ip_address>/api/authentications/2222 {"action": "delete"} or DELETE https://<ip_address>/api/authentications/2222 Expected results: "ActiveRecord::RecordNotFound", HTTP status 404
PR: https://github.com/ManageIQ/manageiq/pull/15736
PR: https://github.com/ManageIQ/manageiq-api/pull/17
The issues is resolved for DELETE method, but is still there for POST method: POST https://<ip_address>/api/authentications/2222 {"action": "delete"} Response: { "success": false, "message": "Couldn't find Authentication with 'id'=2222" }
https://github.com/ManageIQ/manageiq-api/pull/180
New commit detected on ManageIQ/manageiq-api/master: https://github.com/ManageIQ/manageiq-api/commit/7d229d32f63ca56e0f1d4bdd389aa67a62b37f59 commit 7d229d32f63ca56e0f1d4bdd389aa67a62b37f59 Author: Jillian Tullo <jtullo> AuthorDate: Tue Nov 7 10:42:27 2017 -0500 Commit: Jillian Tullo <jtullo> CommitDate: Tue Nov 7 10:42:27 2017 -0500 Ensure delete_action_handler always raises a not found for single resources https://bugzilla.redhat.com/show_bug.cgi?id=1476869 app/controllers/api/base_controller/results.rb | 6 +++++- spec/requests/authentications_spec.rb | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)