Skip to main content

ViewSchema

A ViewSchema is the JSON wire format AUSUS uses to describe a screen. The backend renders a projection into a ViewSchema; the React renderer consumes it. Neither side hard-codes the domain — the ViewSchema carries it.

ViewSchema is defined by RFC-004. v0.1.0 implements a subset of it.

Shape

{
"schemaVersion": "1.0.0",
"targetProfile": "react.web.v1",
"metadata": {
"projection": "billing.invoice.summary",
"entity": "billing.invoice",
"tenant": "acme",
"locale": "en-US",
"generatedAt": "2026-05-20T00:00:00Z"
},
"fields": [ /* FieldDescriptor[] */ ],
"actions": [ /* ActionDescriptor[] */ ],
"filters": [],
"data": { "items": [ /* ... */ ], "pagination": { "nextCursor": null, "pageSize": 1 } }
}
KeyMeaning
schemaVersionthe ViewSchema format version — 1.0.0 in v0.1.0
targetProfilethe rendering profile — react.web.v1 in v0.1.0
metadataprojection / entity / tenant / locale / generation time
fieldsthe columns or detail rows to render
actionsthe actions available on this view
filtersfilter descriptors — always empty in v0.1.0
datathe rows themselves (see below)

data — list vs detail

The data member tells the consumer which view to draw:

// list form
{ items: Record<string, unknown>[], pagination?: { nextCursor: string | null, pageSize: number } }

// detail form
{ item: Record<string, unknown> | null }

// or null

data.items → render a list. data.item → render a detail. The renderer's ViewSchemaConsumer dispatches on exactly this.

FieldDescriptor

interface FieldDescriptor {
name: string;
type: "string" | "integer" | "datetime" | "enum" | "money"
| "identity" | "version" | "system_string";
label: string;
typeOptions?: { maxLength?: number; currency?: string; options?: string[] };
}

The type drives how a cell is rendered — money is formatted with its currency, enum named status becomes a workflow badge, and so on.

ActionDescriptor

interface ActionDescriptor {
fqn: string;
name: string;
label: string;
subjectRequired: boolean;
inputs?: FieldDescriptor[];
confirmation?: { required: boolean; prompt?: string };
}

subjectRequired separates list actions (e.g. create) from item actions (e.g. issue, cancel).

Schema versioning

The renderer checks schemaVersion: it accepts 1.0.x and reports an error for anything else. schemaVersion is how a future ViewSchema revision stays backward-compatible.

Current v0.1.0 limitations

  • filters is always empty — there is no filtering in v0.1.0.
  • pagination.nextCursor is always null — list rendering returns all rows for the tenant.
  • targetProfile is fixed to react.web.v1; locale is fixed to en-US.
  • confirmation is part of the ActionDescriptor type but is not populated by the v0.1.0 backend renderer.