Skip to content

Function: apiObject()

ts
function apiObject<T>(shape): ZodObject<T>;

Defined in: core/apiObject.ts:11

Builds an object schema for a Trello API response.

By default it strips unknown keys (z.object), so a new field added by the Trello API never breaks validation for consumers. When the environment variable TRELLO_STRICT_SCHEMAS is set to 'true' it switches to z.strictObject, turning any undocumented key into a ZodError — used by this package's own test runs to surface gaps between the schemas and the live API.

Type Parameters

Type Parameter
T extends Readonly<{ [k: string]: $ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>; }>

Parameters

ParameterType
shapeT

Returns

ZodObject<T>