Skip to content

jsonValidator

jsonValidator<TCollectionSlug>(slug, fn): FieldValidate<TCollectionSlug, unknown>

Defined in: packages/core/src/fields/json/validator.ts:45

Types a json() field’s validate() against a real collection and DataModel, with value fixed to unknown — the wrapper fieldValidator for this field type.

TCollectionSlug extends string

TCollectionSlug

The owning collection’s slug, used only to infer TCollectionSlug.

FieldValidate<TCollectionSlug, unknown, JsonField<string, BaseFieldMeta>>

The validate callback, checked against the collection’s real document shape and value type.

FieldValidate<TCollectionSlug, unknown>

The same function, re-typed to the field’s loose public validate signature.

fieldValidator