process_schema() fails for recursive schemas #319
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Per https://github.com/googleapis/python-genai/blob/main/google/genai/_transformers.py#L397 the process_schema() function tries to inline all of the $defs in the schema. This generates an infinite recursion for recursive schemas.
Proposal: Provide a
maximum_depth
configurable parameter that will break out of any infinite loops like this at a certain point.Environment details
Steps to reproduce
Observed Behavior:
Expected Behavior:
That the schema would be processed
Test Case
Here is a minimal test case that produces the recursion error. I hope that it's clear.
Thank you!
The text was updated successfully, but these errors were encountered: