Skip to content

Commit

Permalink
Fix text about responders
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Wolf <[email protected]>
  • Loading branch information
christianlupus committed Oct 8, 2024
1 parent 4b76fec commit 08e4aab
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion developer_manual/basics/controllers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ Because returning JSON is such a common task, there's even a shorter way to do t
Why does this work? Because the dispatcher sees that the controller did not return a subclass of a Response and asks the controller to turn the value into a Response. That's where responders come in.

.. _controller-responders:

Responders
^^^^^^^^^^

Expand Down Expand Up @@ -762,7 +764,11 @@ To use OCS in your API you can use the **OCP\\AppFramework\\OCSController** base
}
The format parameter works out of the box, no intervention is required.
For ``OCSController`` classes and their methods, :ref:`responders <controller-responders>` can be registered as with any other ``Controller`` method.
The ``OCSController`` class have however automatically two respnders pre-installed:

Check failure on line 768 in developer_manual/basics/controllers.rst

View workflow job for this annotation

GitHub Actions / Check spelling

respnders ==> responders
Both JSON (``application/json``) and XML (``text/xml``) are generated on-the-fly depending on the request by the browser/user.
To select the output format, the format parameter or the ``Accept`` header of the request work out of the box, no intervention is required.
It is adviced to prefer the header generally, as this is the more programmatic way.

Check failure on line 771 in developer_manual/basics/controllers.rst

View workflow job for this annotation

GitHub Actions / Check spelling

adviced ==> advised

In order to make routing work for OCS routes you need to add a separate 'ocs' entry to the routing table in ``appinf/routes.php`` of your app.
Inside these are normal routes.
Expand Down

0 comments on commit 08e4aab

Please sign in to comment.