Skip to content

Interface: ResourcefulPayloadSchemaGetter()

Function type for generating request-specific payload validation schemas.

These functions are provided via hooks during create and update operations to add additional validation constraints beyond the base model validation. They enable request-specific validation logic based on context.

ts
ResourcefulPayloadSchemaGetter(ctx: HttpContext, app: ApplicationService): PromiseAble<ObjectSchema<any> | null>;

Parameters

ParameterTypeDescription
ctxHttpContextHTTP context containing request information and authentication
appApplicationServiceApplication service instance for accessing app-level services

Returns

PromiseAble<ObjectSchema<any> | null>

Promise resolving to a Joi ObjectSchema for additional validation, or null to skip