OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
On my side, I fixed the issue by running goimports after the generation of the code. Maybe we could run something similar directly inside openapi-generator-cli.
Bug Report Checklist
Description
If a controller have all its operations without Path Param or Body Param, generated code has unused import and compilation will fail.
openapi-generator version
docker
openapitools/openapi-generator-cli:v4.2.2
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix
On my side, I fixed the issue by running
goimports
after the generation of the code. Maybe we could run something similar directly insideopenapi-generator-cli
.