Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions content/docs/api/data-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -371,15 +371,28 @@ Filtering uses the canonical Query DSL `where` object (the same MongoDB-style `F
{ "industry": "Healthcare", "revenue_sum": 80000, "count": 3 }
],
"fields": [
{ "name": "industry", "type": "string", "label": "Industry" },
{ "name": "revenue_sum", "type": "number", "label": "Revenue Sum", "format": "$0,0" },
{ "name": "count", "type": "number", "label": "Count" }
{ "name": "industry", "type": "string" },
{ "name": "revenue_sum", "type": "number" },
{ "name": "count", "type": "number" }
],
"sql": "SELECT ..."
}
}
```

<Callout type="info">
**`fields[]` describes columns, not presentation.** Each entry carries exactly `name` and
`type` — that is the whole descriptor `AnalyticsResultResponseSchema` declares, and every
strategy answering this endpoint emits those two keys and nothing else.

Display name and number format live one layer up, in the **cube's metric/dimension
definition** (`MetricSchema.label` / `MetricSchema.format`, `DimensionSchema.label`), and
are read from cube metadata — `GET /analytics/meta` below reports each measure's and
dimension's declared label as `title`. Reading `data.fields[i].label` or
`data.fields[i].format` off a query result yields `undefined`; a client that renders table
headers or formats amounts reads them from the cube metadata instead.
</Callout>

### `GET /analytics/meta`

Get metadata for all registered cubes. Cubes are explicitly defined (via `defineCube`
Expand Down
Loading