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 } }
}
| Key | Meaning |
|---|---|
schemaVersion | the ViewSchema format version — 1.0.0 in v0.1.0 |
targetProfile | the rendering profile — react.web.v1 in v0.1.0 |
metadata | projection / entity / tenant / locale / generation time |
fields | the columns or detail rows to render |
actions | the actions available on this view |
filters | filter descriptors — always empty in v0.1.0 |
data | the 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
filtersis always empty — there is no filtering in v0.1.0.pagination.nextCursoris alwaysnull— list rendering returns all rows for the tenant.targetProfileis fixed toreact.web.v1;localeis fixed toen-US.confirmationis part of theActionDescriptortype but is not populated by the v0.1.0 backend renderer.
Related
- Projections — what renders into a ViewSchema.
- The HTTP API — serves ViewSchemas.
- The React renderer — consumes them.