Skip to content

ShapeKind

reference
1 min readUpdated

Kind: Type

Source: atloria-monorepo/packages/ui-core/src/components/api-explorer/preview-shape.ts

Read the response, then pick how to show it.

The Preview is where someone decides "is this the data I wanted, and which fields do I need?" — so it deserves more than one dumb table. Forcing every response through a single renderer produces three bad outcomes: nested objects become truncated JSON blobs, columns arrive in field order (uri before name), and a single object becomes a pointless one-row table.

Two rules do most of the work: detect the shape, then rank the columns. Everything here is pure, so it can be reasoned about and tested directly.

Definition

ts
'table' | 'record' | 'values' | 'tree' | 'empty' | 'error'

Was this page helpful?

Download as PDF