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
Python: make_instance generates syntax error for optional nullable fields with default null in nested objects #25047
When an optional nullable field with anyOf: [type: object, type: null] appears as the 4th field in an object, the Python test generator produces invalid syntax:
Updated finding: tested with 8 nullable anyOf fields (prop1–prop8). Bug only triggers on prop4 (the 4th nullable field), not on prop5–prop8. So it's specifically the 4th nullable anyOf field, not all of them.
Tested with 8 nullable anyOf fields (prop1–prop8 all nullable). Bug still only triggers on prop4 (the 4th field overall), not prop5–prop8. Confirmed it's the 4th field, not the 4th nullable.
Please provide more details about what generated model that contains the error so it is possible to fully understand the reported issue (e.g., provide the name of the generated file and a larger context that illustrates where the prop is initialized incorrectly).
Please also state what version of the generator that you are using.
Activity
sieira commentedon Sep 29, 2026
Updated finding: tested with 8 nullable anyOf fields (prop1–prop8). Bug only triggers on prop4 (the 4th nullable field), not on prop5–prop8. So it's specifically the 4th nullable anyOf field, not all of them.
sieira commentedon Sep 29, 2026
Tested with 8 nullable anyOf fields (prop1–prop8 all nullable). Bug still only triggers on prop4 (the 4th field overall), not prop5–prop8. Confirmed it's the 4th field, not the 4th nullable.
Mattias-Sehlstedt commentedon Sep 29, 2026
Please provide more details about what generated model that contains the error so it is possible to fully understand the reported issue (e.g., provide the name of the generated file and a larger context that illustrates where the prop is initialized incorrectly).
Please also state what version of the generator that you are using.
[python] Fix empty example value for siblings that share a model (Ope…