View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0032858 | mantisbt | api rest | public | 2023-08-25 02:46 | 2023-10-31 16:32 | |||||||||||||||||||||||||||||||||
Reporter | dregad | Assigned To | dregad | |||||||||||||||||||||||||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | |||||||||||||||||||||||||||||||||
Status | closed | Resolution | fixed | |||||||||||||||||||||||||||||||||||
Target Version | 2.26.0 | Fixed in Version | 2.26.0 | |||||||||||||||||||||||||||||||||||
Summary | 0032858: Status codes returned by REST API delete operations are not consistent | |||||||||||||||||||||||||||||||||||||
Description | This originates from a discussion in PR https://github.com/mantisbt/mantisbt/pull/1905. Currently, some API endpoints return 200/204, others 400/404 and even a 403. See table below for details.
We should have a consistent behavior across DELETE endpoints. It was agreed to switch to 404. The following will need to be adapted
| |||||||||||||||||||||||||||||||||||||
Additional Information |
| |||||||||||||||||||||||||||||||||||||
Tags | No tags attached. | |||||||||||||||||||||||||||||||||||||
related to | 0032835 | closed | dregad | REST API errors when attempting to add or delete issue relationships |
related to | 0030415 | closed | vboctor | REST API: Add API to Get / Delete / Update versions |
related to | 0032862 | closed | vboctor | REST API documentation for Issue Tag Detach is incorrect |
related to | 0032232 | closed | dregad | Create ProjectDeleteCommand |
Project version delete will be fixed with PR https://github.com/mantisbt/mantisbt/pull/1905 |
|
On second thoughts, I believe it is better if While it's technically a DELETE operation, we are not actually deleting the tag, just detaching it from the issue. This way we're consistent with the opposite Attach operation's behavior, which just succeeds even if the tag was already attached to the issue. |
|
MantisBT: master 59f62a71 2023-08-26 12:09 Details Diff |
Adapt RestUserTests::testDeleteUserById() Update the test case to prepare for change of returned status code to 404 when trying to delete a non-existing user. Remove the assertion from RestBase::tearDown(), the check for a successful deletion should be done in the actual test cases. Issue 0032858 |
Affected Issues 0032858 |
|
mod - tests/rest/RestBase.php | Diff File | ||
mod - tests/rest/RestUserTest.php | Diff File | ||
MantisBT: master 14552850 2023-08-26 12:14 Details Diff |
Add test cases for Issue Tag Attach/Detach Covering - attach a new tag - attach existing tag - detach tag - detach unattached tag - detach non-existing tag - attach/detach on non-existing issue Issue 0032858 |
Affected Issues 0032858 |
|
mod - tests/rest/RestIssueTest.php | Diff File | ||
MantisBT: master 40df3eb9 2023-08-26 12:19 Details Diff |
TagDetachCommand: ensure tag exists Fixes 0032858 |
Affected Issues 0032858 |
|
mod - core/commands/TagDetachCommand.php | Diff File | ||
MantisBT: master f095e36b 2023-08-26 12:22 Details Diff |
UserDeleteCommand: ensure user exists Fixes 0032858 |
Affected Issues 0032858 |
|
mod - core/commands/UserDeleteCommand.php | Diff File | ||
MantisBT: master bddf5d32 2023-08-26 13:05 Details Diff |
Use ProjectDeleteCommand in rest_project_delete() Fixes 0032232, 0032858 |
Affected Issues 0032232, 0032858 |
|
mod - api/rest/restcore/projects_rest.php | Diff File |