Unit/System Tests Webservices PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
10 Jun 2025

Pull Request for Issue # .

Summary of Changes

According to the HTTP/REST specification, a DELETE request for a resource that does not exist should respond with 204 No Content or 404 Not Found.

Testing Instructions

execute a DELETE api/index.php/v1/content/articles/99 for a non existent item

Actual result BEFORE applying this Pull Request

{ "errors": [ { "code": 500, "title": "Internal server error" } ] }

Expected result AFTER applying this Pull Request

return 204

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar alikon alikon - open - 10 Jun 2025
avatar alikon alikon - change - 10 Jun 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jun 2025
Category Libraries
avatar richard67
richard67 - comment - 10 Jun 2025

@alikon The title and the expected result say "204". Did you mean "404"?

avatar alikon
alikon - comment - 10 Jun 2025
avatar richard67
richard67 - comment - 10 Jun 2025

no i mean http status code 204 https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/204

I see. Thanks for clarification.

avatar muhme
muhme - comment - 11 Jun 2025

@alikon Would it not be great to have this in System Tests?

avatar alikon alikon - change - 13 Jun 2025
Labels Added: Webservices PR-5.3-dev
avatar joomla-cms-bot joomla-cms-bot - change - 13 Jun 2025
Category Libraries Libraries JavaScript Unit Tests
avatar alikon alikon - change - 13 Jun 2025
Labels Added: Unit/System Tests
avatar alikon
alikon - comment - 13 Jun 2025

@muhme did you mean like that ?

avatar muhme
muhme - comment - 13 Jun 2025

@alikon Thank you for adding single System Tests 👍 As this counts for all ressouces, should we add the test everywhere? Or, if this is too expensive, creating one new test like checking-api-status?

And sorry for jumping in at the end — from what I understand, 204 'No Content' is used when a resource is successfully deleted, so there’s nothing to return. If the resource doesn’t exist, then 404 'Not Found' would be the appropriate response — wouldn’t it?

avatar alikon
alikon - comment - 13 Jun 2025

@muhme

As this counts for all ressouces, should we add the test everywhere? Or, if this is too expensive, creating one new test like checking-api-status?

consider that some api test even don't test the delete endpoint , so don't know what's better

And sorry for jumping in at the end — from what I understand, 204 'No Content' is used when a resource is successfully deleted, so there’s nothing to return. If the resource doesn’t exist, then 404 'Not Found' would be the appropriate response — wouldn’t it?

According to the HTTP/REST specification, a DELETE request for a resource that does not exist should respond with 204

Add a Comment

Login with GitHub to post a comment