The current endpoint to manage extensions /installer is based on com_installer. It publishes the /installer, the com_installer internal component, as a first-level entry-point of the REST API to manage extensions on Joomla 4.
This is not following REST practices and it differents from the other endpoints semantic, based on data entities or CMS concepts: https://docs.joomla.org/J4.x:Joomla_Core_APIs
Additionally, the current /installer endpoint is being directly translated from the MVC into the rest API.
index.php?option=com_installer&view=manage
is translated to /installer/manage?...
This is not following a good REST semantic Provide Sensible Resource Names (https://www.restapitutorial.com/lessons/restquicktips.html) and it is a direct translation of the current MVC internal implementation.
It would be better to follow the semantic of the previous endpoints and change the endpoint to /extensions and align the actions to the expected meaningful actions.
For instance, to install an extension you should do a POST /api/index.php/v1/extensions/install
. Extension as the Noun and Install as the Action.
Manage is not a good action since all actions of the extensions manager can be classified as management.
It would be clearer to have an API like this:
GET /api/index.php/v1/extensions
PUT /api/index.php/v1/extensions/{id}
POST /api/index.php/v1/extensions/{id}/publish
The current REST API is based on the current UI.
Joomla 4 REST API
This issue started on #32769 and @wilsonge asked to discuss it separately.
Hi, Thanks @alikon for the PR.
/list
is not needed as an endpoint. Check that there is no similar /list
noun in the current API: https://docs.joomla.org/J4.x:Joomla_Core_APIs
A list can be provided simply with GET /api/index.php/v1/extensions
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-04-26 17:29:31 |
Closed_By | ⇒ | alikon |
@anibalsanchez
so an
http://dev4.loc/api/index.php/v1/extensions/list
it's better than
http://dev4.loc/api/index.php/v1/installer/manage
?