diff --git a/content/docs/api/data-api.mdx b/content/docs/api/data-api.mdx index 2c3870466e..b6f4bf522b 100644 --- a/content/docs/api/data-api.mdx +++ b/content/docs/api/data-api.mdx @@ -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 ..." } } ``` + +**`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. + + ### `GET /analytics/meta` Get metadata for all registered cubes. Cubes are explicitly defined (via `defineCube`