fix(transform schema): preserve $defs when schema root is a $ref (#1642)
transform_schema() early-returns when the schema root contains $ref,
which discards a sibling $defs and produces a schema with a dangling
reference. Pydantic v2 emits exactly this shape for RootModel types
({"$ref": "#/$defs/X", "$defs": {...}}), so any RootModel output
type hits this.
Process $defs before the $ref early-return so referenced definitions
are preserved. Bare $ref schemas (no siblings) are unchanged. B
benlehrburger-ant committed
fc58e06b78407b447c50dfea109c6fb300f4b97d
Parent: ddd43b7
Committed by GitHub <noreply@github.com>
on 6/4/2026, 4:38:05 PM