You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
isProvablyObjectShapedRoot does not recognize $defs/$ref to typeless object-shaped schemas (e.g. named discriminatedUnion) #3094
In commit 5820f796 (#3081), isProvablyObjectShapedRoot in packages/core-internal/src/util/standardSchema.ts was updated to follow a same-document $ref into $defs / definitions, checking target?.type === 'object'.
When a $defs / definitions entry is a typeless object-shaped schema like z.discriminatedUnion('kind', [z.object(...), z.object(...)]).meta({ id: 'Result' }) (or a union/intersection of objects, or an object schema with properties that omits type: 'object'), target.type === 'object' returns false and wraps structuredContent in { result: ... }, even though the identical schema written inline without .meta({ id }) returns true.
Should isProvablyObjectShapedRoot also check isProvablyObjectShapedRoot(target, {}) when resolving a $ref target?
Activity