Interface ResourceConfig

Fully resolved metadata for one resource, derived from the OpenAPI paths and schemas. This is the object every list/form/detail view is driven by.

interface ResourceConfig {
    displayFormat: string;
    displayName: string;
    fields: FieldConfig[];
    listColumns: string[];
    name: string;
    operations: {
        create: boolean;
        delete: boolean;
        get: boolean;
        list: boolean;
        patch: boolean;
        update: boolean;
    };
    orderedFields: FieldConfig[];
    pagination: | null
    | { defaultLimit: number; limitParam: string; offsetParam: string };
    parent?: { pathParam: string; resource: string };
    path: string;
    primaryKey: string;
    relationships: ResourceRelationship[];
    schemaName: string;
    streaming?: boolean;
    subResources?: string[];
    updateMethod: "put" | "patch";
}

Properties

displayFormat: string

Template used to render a row/item title (x-display-format).

displayName: string

Human-friendly label used in navigation and titles.

fields: FieldConfig[]

All fields, sorted by x-order then name.

listColumns: string[]

Columns shown in the list view (x-list-columns).

name: string

Resource name (path segment), e.g. "expenses".

operations: {
    create: boolean;
    delete: boolean;
    get: boolean;
    list: boolean;
    patch: boolean;
    update: boolean;
}

Which CRUD operations the spec exposes.

orderedFields: FieldConfig[]

Fields in fields restricted to those with a defined order.

pagination:
    | null
    | { defaultLimit: number; limitParam: string; offsetParam: string }

Pagination contract, or null when the collection is not paginated.

parent?: { pathParam: string; resource: string }

Set when this is a sub-resource (nested under a parent resource).

path: string

Base API path for the collection, e.g. "/expenses".

primaryKey: string

Primary-key property name (x-primary-key).

relationships: ResourceRelationship[]

Foreign-key relationships for this resource.

schemaName: string

Schema name used for display and lookups.

streaming?: boolean

true when the collection is an x-sse event stream.

subResources?: string[]

Names of nested sub-resources.

updateMethod: "put" | "patch"

Whether updates use PUT or PATCH.