Something went wrong while setting issue due date.
REST API returns empty array instead of empty object
Closed
REST API returns empty array instead of empty object
In PHP arrays and associative arrays are the same type.
This is not true in JSON or in perl, so there are problems with the REST API, for instance when searching for objects, a JSON object is supposed to be returned by the endpoint, but if there are no results, the empty associative array is encoded as an empty JSON array, not an empty JSON object.
So we should review endpoints which are supposed to return a JSON object and make sure they return a JSON object even if empty. The problem may still appear deeper in the result tree but this will be a good first step and fix the empty search result case which is the most common.