diff --git a/lib/schema.ts b/lib/schema.ts index ae5bb7d46..a1c6281b1 100644 --- a/lib/schema.ts +++ b/lib/schema.ts @@ -317,6 +317,10 @@ function safeAccess(obj: Record, path: string) { if (Number.isNaN(parsedIndex)) return undefined; return arrayValue[parsedIndex]; } + // If current value is an array and we're accessing a named property, use the first element + if (Array.isArray(acc)) { + return acc[0]?.[part]; + } return acc && acc[part]; }, obj); }