OpenAPI spec generated for union type with discriminator, generate default value instead of enum to allow using openapi-generator-maven-plugin #9866
Answered
by
joachimvda
Joachim Van der Auwera (joachimvda)
asked this question in
OpenAPI3
|
I have a union type like this: This generates the following model which does not work for openapi-generator-maven-plugin. Specifically the enum in the subtypes should be a default value instead. Is there a way to force the type property to be generated with a default string instead to produce This does produce working code when using openapi-generator-maven-plugin. Thanks for the help |
Answered by
joachimvda
Mar 29, 2026
Replies: 2 comments
|
In another attempt, I tried using something like This does not work as it produces errors |
0 replies
|
Found a workaround |
0 replies
Answer selected by
joachimvda
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found a workaround