Skip to content

Define a canonical ComponentSpec schema + server-side validation #32

Description

@ai-naymul

Goal

Define one canonical ComponentSpec contract shared by backend and frontend, so scraped data can be rendered as a dashboard reliably.

Scope

  • A single schema for ComponentSpec (type, props, children) and LayoutSpec, documented in one place.
  • Supported component types (initial): metric_card, bar_chart, line_chart, pie_chart, comparison_table, data_grid, map, plus layout primitives (grid, stack, text, divider, spacer).
  • Server-side validation with required-prop checks and a safe fallback component for invalid specs (never render [object Object] or crash).
  • Retire any second, competing UI-spec concept so there is exactly one contract.

Acceptance criteria

  • Schema documented and validated on the server before responses are returned.
  • Invalid/partial specs degrade to a fallback card instead of erroring.
  • Frontend and backend agree on prop names (no ad-hoc remapping in the renderer).

Part of the v2.0 — Generative UI milestone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions