Jake B.
Well-known member
- Affected version
- 2.1.0 Betas
The JSON response in all of the endpoints (at least the ones I've noticed so far) are returning objects for a list of multiple items, this results in any sort of order/sorting being broken when parsed by some languages (such as JavaScript) as, by definition:
Compared to:
So if you parse the JSON string into an object using JSON.parse it will result in the items being ordered by the key rather than the intended order the API returned them in. Changing this behavior could potentially be a breaking change if anyone is consuming the API currently and assuming that the key of the item is equal to its ID, but not changing it will result in sorting being broken on many languages that do not keep the order of objects which is likely going to be a much larger issue in the long term.
An object is an unordered set of name/value pairs.
Compared to:
An array is an ordered collection of values.
So if you parse the JSON string into an object using JSON.parse it will result in the items being ordered by the key rather than the intended order the API returned them in. Changing this behavior could potentially be a breaking change if anyone is consuming the API currently and assuming that the key of the item is equal to its ID, but not changing it will result in sorting being broken on many languages that do not keep the order of objects which is likely going to be a much larger issue in the long term.