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
Originally, #6055 reported the fact that the annotations from additionalModelTypeAnnotations do not get applied to enumerations when using the Java generator. This was subsequently fixed via #8389 by adding a new additionalEnumTypeAnnotations option. However, this only applies to the Java generator, and this option is still missing from the Kotlin generator. As far as I know, there is currently no configuration that applies a certain annotation to all generated enums.
openapi-generator version
using the gradle plugin with version 6.6.0
OpenAPI declaration file content or url
This is the same spec that is given as an example in #6055:
Specifying an additionalEnumTypeAnnotations option in the additional properties has no effect on generated enums (because that behaviour has only been implemented for the Java generator)
Steps to reproduce
run: generate -g kotlin -p additionalModelTypeAnnotations=@Foo for the given spec
inspect the generated enum: It does not have the @Foo annotation
run: generate -g kotlin -p additionalEnumTypeAnnotations=@Foo for the given spec
inspect the generated enum: It does not have the @Foo annotation
I suggest adding the additionalEnumTypeAnnotations option to the additional properties of the Kotlin generator, with functionality analogous to the option for the Java generator (#8389).
The text was updated successfully, but these errors were encountered:
Bug Report Checklist
Description
Originally, #6055 reported the fact that the annotations from
additionalModelTypeAnnotations
do not get applied to enumerations when using the Java generator. This was subsequently fixed via #8389 by adding a newadditionalEnumTypeAnnotations
option. However, this only applies to the Java generator, and this option is still missing from the Kotlin generator. As far as I know, there is currently no configuration that applies a certain annotation to all generated enums.openapi-generator version
using the gradle plugin with version
6.6.0
OpenAPI declaration file content or url
This is the same spec that is given as an example in #6055:
Generation Details
Specifying an
additionalEnumTypeAnnotations
option in the additional properties has no effect on generated enums (because that behaviour has only been implemented for the Java generator)Steps to reproduce
generate -g kotlin -p additionalModelTypeAnnotations=@Foo
for the given spec@Foo
annotationgenerate -g kotlin -p additionalEnumTypeAnnotations=@Foo
for the given spec@Foo
annotationRelated issues/PRs
#6055
#8389
Suggest a fix
I suggest adding the
additionalEnumTypeAnnotations
option to the additional properties of the Kotlin generator, with functionality analogous to the option for the Java generator (#8389).The text was updated successfully, but these errors were encountered: