Skip to content

docs: the Data API page's fields[] callout is stale — AnalyticsResult.fields now declares label / format / currency / percentScale #16141

Description

@baozhoutao

Recording only — not claimed, no assignee. Found while working #14546 (SDK payload reads on the same page); out of scope there and deliberately left untouched by that PR.

Where

content/docs/api/data-api.mdx, the Callout type="info" under POST /analytics/query (lines 421-433 on origin/main @ 1f2a02ba0).

What it says

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

Why it is false today

Both halves of the claim are contradicted by the tree it names:

So a reader is told to ignore members the producer ships specifically for them, and to go fetch cube metadata instead — the opposite of what the ADR-0053 / percent-scale chains were built for.

History — the callout was true when it was written

#6369 (closed) wrote this callout at a time when the runtime really did emit { name, type } only. #13078 then moved the SCHEMA to the contract rather than the contract to the schema, which inverted the callout without touching the page. This is drift from a landed correction, not an original error.

Executable criterion

grep -n "percentScale\|currency\|label" packages/spec/src/api/analytics.zod.ts inside AnalyticsResultResponseSchema returns the four optional members; the callout says the descriptor is name + type "and nothing else". Positive control today: both statements are in the tree at the same time.

Not in scope for #14546

That card is one payload read per example, on three named sites; it is scoped and this is a different defect class (false prose about a descriptor). #14546 remains open on its own terms and this is not addressed by its PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions