validateFieldDependsOn
validateFieldDependsOn(
props):void
Defined in: packages/core/src/fields/validateFieldDependsOn.ts:27
Validates every top-level field’s dependsOn against the resource’s own
top-level field keys — the same flattened universe (getDataFields, which
hoists row()/collapsible()/unnamed-tabs() children up and leaves
group()/array()/blocks() as single data fields) resolveCollectionIndexes
already checks a field-level index’s additionalFields against.
A field nested inside a group()/array()/blocks() is never visited
here — getDataFields does not descend into one — so a dependsOn set on
such a field is never checked. That matches its complete lack of runtime
effect: validateFields only ever runs a TOP-LEVEL field’s own
validate() (fields/validate.ts), so a nested field’s own
validate()/dependsOn never individually runs regardless of what it names.
Parameters
Section titled “Parameters”string
The error-message prefix naming the collection/global —
defineCollection: collection "posts" or defineGlobal: global "siteSettings".
fields
Section titled “fields”Record<string, AdminField>
The resource’s own (pre-flatten) field map.
resourceNoun
Section titled “resourceNoun”"collection" | "global"
"collection" or "global", for the “is not a
field of this ___” message.
Returns
Section titled “Returns”void
Throws
Section titled “Throws”When a field’s dependsOn names a key that is not
one of this resource’s own top-level field keys.