From b8b0411f1c41ba42e947f1d6d4fec6f9abb96186 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Fri, 28 Feb 2025 18:23:27 +0100 Subject: [PATCH] Apply suggestions from code review Signed-off-by: Christian Wolf --- developer_manual/basics/controllers.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/developer_manual/basics/controllers.rst b/developer_manual/basics/controllers.rst index 14896c5a4..c8de6729c 100644 --- a/developer_manual/basics/controllers.rst +++ b/developer_manual/basics/controllers.rst @@ -480,7 +480,10 @@ Both JSON (``application/json``) and XML (``text/xml``) are generated on-the-fly To select the output format, the ``?format=`` query parameter or the ``Accept`` header of the request work out of the box, no intervention is required. It is advised to prefer the header generally, as this is the more standardized way. -In order to make routing work for OCS routes you need to add :ref:`a separate 'ocs' entry` to the routing table in ``appinfo/routes.php`` of your app. +To make routing work for OCS, the route must be registered in the core. +This can be done in two ways: +You can add an attribute `#[ApiRoute]` to the controller method. +Alternatively, you can add :ref:`a separate 'ocs' entry` to the routing table in ``appinfo/routes.php`` of your app. Inside these, there are the same information as there are for normal routes. .. code-block:: php