Skip to content
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 not generating compilable code, enum import issue #20438

Open
jimcornmell opened this issue Jan 10, 2025 · 0 comments
Open

Comments

@jimcornmell
Copy link

Bug Report Checklist

  • I have validated the input using an validator
  • I have tested with the latest master to confirm the issue still exists.
  • I have searched for related issues/PRs.
Description

The kotlin generator and the generated code will not compile as imports for enum are missing.

openapi-generator version

v7.10.0, also tried latest (as of 2025/01/10).

OpenAPI declaration file content or url

Please provide email to send url in private.

Steps to reproduce
  • Run generator
openapi-generator \
    generate \
    --package-name com.name.generated \
    -i https://.../...-swagger.json \
    --global-property models,modelDocs=false,modelTests=false,apis,apiDocs=false,apiTests=false,supportingFiles \
    -g kotlin \
    -o .
  • Try and compile code.
  • Several files will not compile, e.g: CancelPoliciesApi.kt line 156 COMPACT enum has not been imported.
  • If I go through each file with issues and add the import for the enum by hand the issue is resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant