Restler icon indicating copy to clipboard operation
Restler copied to clipboard

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

Open DavidCasillasRivero opened this issue 2 years ago • 0 comments

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.

DavidCasillasRivero avatar May 05 '23 10:05 DavidCasillasRivero