Skip to content

Playground REST API tab should display array format for order parameter #10328

@samjewell

Description

@samjewell

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    client:playgroundIssues relating to the Developer Playgroundhelp wantedCommunity contributions are welcome.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions