Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 315 forks source link

Breaking change in 5.0.11. Empty objects are now returned as arrays #687

Open DavidCasillasRivero opened 1 year ago

DavidCasillasRivero commented 1 year ago

The changes in 5.0.11 break some funtionallity in our application. For example the response pasted below from our API changes the empty JSON object in the field_filters property to an array.

Debuging the Data/Obj.php class the property gets there as a PHP Std object. That was required until now so it was converted to an empty object an not an array , but now that is broken.

{
        "a8d887fd-1884-4c67-970a-988f3bcc6a52": {
            "id": "a8d887fd-1884-4c67-970a-988f3bcc6a52",
            "filter_label": "Default",
            "filter_sort": 0,
            "is_default": true,
            "field_filters": { }
        }
    }
{
        "a8d887fd-1884-4c67-970a-988f3bcc6a52": {
            "id": "a8d887fd-1884-4c67-970a-988f3bcc6a52",
            "filter_label": "Default",
            "filter_sort": 0,
            "is_default": true,
            "field_filters": []
        }
    }

Was this an expected change? In that case it should have been annotated as breaking change.