-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Kotlin generator produces invalid code when allOf is used #10792
Comments
We have the same issue. With some debugging, I see that When we remove the I will try to submit a pull request. |
Basic PR with steps to reproduce |
The pull request is redy for review 🙂 |
Was the PR merged? I met the same problem with openapi-generator-maven-plugin 6.4.0. |
The pr was only for the kotlin generator |
@alexbudarov can you please give it a try with the latest master to see if you still experience the same issue? |
According to https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/kotlin.md#schema-support-feature "allOff" feature is not yet supported. If PR #12594 fixes that, please update the documentation 👍 However, I get wrong generated code using "allOff", but it might be caused by some other issue. |
This seems to be fixed in 7.0.1 |
[BUG] Kotlin generator produces invalid code when allOf is used
Description
The Kotlin generator produces invalid code when using
allOf
in the SpecActual
Expected
The generated code for the class
Bird
is attempting to call the constructor on theAnimal
interface it is implementing. Kotlin interfaces do not have constructors.openapi-generator version
The bug exists using
5.3.0
, the issue is not present in5.2.1
OpenAPI declaration file content or url
Generation Details
Use openapi-generator-cli version
5.3.0
#!/bin/sh openapi-generator-cli generate \ --generator-name kotlin \ --input-spec schema.yaml \ --output output \ --config config.yaml \ --template-dir templates \ --ignore-file-override .openapi-generator-ignore
All supporting files (including this script) are contained in the attached file issue.zip
Steps to reproduce
unzip issue.zip
cd issue; ./generate.sh
output/generated/com/example/api/models/Bird.kt
Related issues/PRs
N/A
Suggest a fix
The bug exists in
5.3.0
, the issue is not present in5.2.1
The text was updated successfully, but these errors were encountered: