Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/core / requiredFieldsValidator

Function: requiredFieldsValidator()

ts
function requiredFieldsValidator(options): FinishValidator;

Defined in: packages/core/src/orchestrator/finish-validators.ts:524

Requires the result to be a JSON object carrying every named field with a substantial value: present, not null, and not an empty or whitespace only string (empty arrays, zero, and false COUNT as present; emptiness rules beyond strings belong to a custom validator). Default name 'required-fields'.

Parameters

ParameterType
options{ fields: readonly string[]; name?: string; }
options.fieldsreadonly string[]
options.name?string

Returns

FinishValidator