Repository navigation
Commit 4882687
authored
[python] Fix empty example value for siblings that share a model (#25106)
toExampleValueRecursive tracks the ancestors of the current schema in
includedSchemas to stop on cycles, but the same list was passed to every
property of an object. When three or more sibling properties referenced
the same model (e.g. inline objects the generator deduplicates into one
model), the third one was mistaken for a cycle and got an empty value,
producing 'prop4 = ,' in the generated tests.
Give each property its own copy of the ancestor list.
Fixes #250471 parent 21c2f86 commit 4882687
2 files changed
Lines changed: 27 additions & 1 deletion
File tree
- modules/openapi-generator/src
- main/java/org/openapitools/codegen/languages
- test/java/org/openapitools/codegen/python
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
613 | 616 | | |
614 | | - | |
| 617 | + | |
615 | 618 | | |
616 | 619 | | |
617 | 620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
220 | 243 | | |
221 | 244 | | |
222 | 245 | | |
| |||
0 commit comments