Open ivanvasheka-intellias opened 1 year ago
@ivanvasheka-intellias did you find a workaround for this?
I am having the very same issue, but java + retrofit2 code generation options
@ivanvasheka-intellias did you find a workaround for this?
I am having the very same issue, but java + retrofit2 code generation options
Yes. So the workaround for me was to allow generator to generate that exact file by adding this to the configuration:
task.globalProperties = [
supportingFiles: "CollectionFormats.kt"
]
With this setting that file is generated and the import is valid despite the file not being used anywhere...
Description
When generating code using kotlin generator with options to generate APIs and models files only, and using retrofit2 library, generator generates API files without infrastructure package, but API files contain imports of infrastructure classes which results into an error. In particular this one:
import com.example.api.infrastructure.CollectionFormats.*
openapi-generator version
6.3.0
OpenAPI declaration file content or url
task generateApi(type: GenerateTask) { generateApi.generatorName = "kotlin" generateApi.packageName = "com.example.api" generateApi.inputSpec = "api.json" generateApi.outputDir = "$rootDir/api" generateApi.skipValidateSpec = true
}
Steps to reproduce
generate API files using provided options open any API file check imports