-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Description
The Playground's REST API tab displays the order parameter as an object:
"order": {
"orders.raw_customers_last_name": "asc",
"orders.raw_customers_first_name": "desc"
}However, Cube's own documentation recommends the alternative order format (array) for reliable multi-column ordering:
"order": [
["orders.raw_customers_last_name", "asc"],
["orders.raw_customers_first_name", "desc"]
]Why this matters
-
JSON object key order is not guaranteed by RFC 7159. While modern JS engines preserve insertion order, this is implementation-dependent and can break across different languages, parsers, or environments.
-
The REST API tab's purpose is to provide copyable examples for integrators. Showing the object format sets developers up for subtle ordering bugs when they copy it into their applications.
-
Consistency: Issue Vue's query builder should use alternative order format #7217 already requests that Vue's query builder use the array format. The Playground's REST API tab should follow the same principle.
Expected behavior
The REST API tab should display the array format that Cube recommends in its documentation, so integrators copy the reliable format.
Related
- Vue's query builder should use alternative order format #7217 - Vue's query builder should use alternative order format
- Update query format API to support ordered
orderspecification #773 / PR Resolve 773: Update query format API to support ordered order specification #973 - Original work to support orderedorderspecification