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
| Parameter | Type |
|---|---|
options | { fields: readonly string[]; name?: string; } |
options.fields | readonly string[] |
options.name? | string |