Commit cb7a964
Fix review issues: parent constructor call and hasVars/hasRequired flags
Address two issues identified by cubic code review:
1. Always emit parentheses in parent constructor call when
`useSealedDiscriminatorClasses` is enabled, even when
`x-parent-ctor-args` is absent. This prevents invalid Kotlin like
`: Parent` when the parent is a sealed class (should be `: Parent()`).
2. Update `hasVars` and `hasRequired` flags on child models after adding
discriminator properties in the oneOf pattern. Without this, a child
with no other properties would generate `class Cat(...)` instead of
`data class Cat(...)`.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 1af1d1c commit cb7a964
2 files changed
Lines changed: 5 additions & 1 deletion
File tree
- modules/openapi-generator/src/main
- java/org/openapitools/codegen/languages
- resources/kotlin-spring
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1394 | 1394 | | |
1395 | 1395 | | |
1396 | 1396 | | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1397 | 1401 | | |
1398 | 1402 | | |
1399 | 1403 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments