We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afddade commit 8ff4db7Copy full SHA for 8ff4db7
pydantic_ai_slim/pydantic_ai/profiles/openai.py
@@ -157,7 +157,12 @@ def walk(self) -> JsonSchema:
157
if self.root_ref is not None:
158
result.pop('$ref', None) # We replace references to the self.root_ref with just '#' in the transform method
159
root_key = re.sub(r'^#/\$defs/', '', self.root_ref)
160
- result.update(self.defs.get(root_key) or {})
+ # Use the transformed schema from $defs, not the original self.defs
161
+ if '$defs' in result and root_key in result['$defs']:
162
+ result.update(result['$defs'][root_key])
163
+ else:
164
+ # Fallback to original if transformed version not available (shouldn't happen in normal flow)
165
+ result.update(self.defs.get(root_key) or {})
166
167
return result
168
0 commit comments