cube-js/cube

Playground REST API tab should display array format for order parameter

Open

Aperta il 22 gen 2026

Vedi su GitHub
 (3 commenti) (1 reazione) (0 assegnatari)Rust (19.563 star) (1965 fork)batch import
client:playgroundhelp wanted

Descrizione

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

  1. 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.

  2. 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.

  3. Consistency: Issue #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

  • #7217 - Vue's query builder should use alternative order format
  • #773 / PR #973 - Original work to support ordered order specification

Guida contributor