Skip to content

Commit

Permalink
docs: add changelog and upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Feb 4, 2024
1 parent 654616f commit fac0fe2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions user_guide_src/source/changelogs/v4.5.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ Due to a bug fix, the behavior has changed so that options passed to the outer
``group()`` are merged with the options of the inner ``group()``.
See :ref:`Upgrading Guide <upgrade-450-nested-route-groups-and-options>` for details.

API\\ResponseTrait
------------------

Now when a response format is JSON, if you pass string data, the framework returns
a JSON response. In previous versions, it returned a HTML response.
See :ref:`Upgrading Guide <upgrade-450-api-response-trait>` for details.

Factories class
---------------

Expand Down
14 changes: 14 additions & 0 deletions user_guide_src/source/installation/upgrade_450.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ reversed.
Previous: route1 → route2 → filter1 → filter2
Now: route2 → route1 → filter2 → filter1

.. _upgrade-450-api-response-trait:

API\\ResponseTrait and String Data
==================================

In previous versions, if you pass string data to a trait method, the framework
returned an HTML response, even if the response format was determined to be JSON.

Now if you pass string data, it returns a JSON response correctly. See also
:ref:`api-response-trait-handling-response-types`.

You can keep the behavior in previous versions if you set the ``$stringAsHtml``
property to ``true`` in your controller.

FileLocator::findQualifiedNameFromPath()
========================================

Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/outgoing/api_responses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ exist for the most common use cases:

.. literalinclude:: api_responses/002.php

.. _api-response-trait-handling-response-types:

***********************
Handling Response Types
***********************
Expand Down

0 comments on commit fac0fe2

Please sign in to comment.