BeechCMS / @beechcms/core / ValidateSeedPayloadOptions
Interface: ValidateSeedPayloadOptions
Options to configure the validation and sanitization behavior of the seed payload.
Properties
allowNull?
optionalallowNull?:boolean
Whether to allow fields to be explicitly null.
Default
falseenforceRequiredFields?
optionalenforceRequiredFields?:boolean
Whether to enforce validation of required fields (requiredOnCreate or requiredOnUpdate).
Default
trueidGenerator?
optionalidGenerator?:IIdGenerator
Required when the seed has branches of type 'relation'. Must be the same IIdGenerator instance used for id generation so that swapping implementations (e.g. ULIDs) automatically updates validation. Do NOT pass a concrete class — inject via the middleware / factory.
localeConfig?
optionallocaleConfig?:LocaleConfig
Project language configuration. When provided, branches with localized: true accept a plain value (stored under defaultLocale) or a locale dictionary, and validate to a LocalizedPatch. When omitted, localized branches validate exactly like their base type — the pre-localization contract. requiredOnCreate / requiredOnUpdate then check the default locale only.
maxTextLength?
optionalmaxTextLength?:number
The maximum allowed length (in characters/bytes) for text and rich text fields.
Default
50000operation?
optionaloperation?:"create"|"update"
The type of operation being validated, which determines whether requiredOnCreate or requiredOnUpdate branch constraints are applied.
Default
'create'requireAtLeastOneValidField?
optionalrequireAtLeastOneValidField?:boolean
If true, validation will fail if the resulting data payload contains no valid fields.
Default
true