OpenAPITools / OpenAPITools/openapi-generator
[BUG] openapi-generator-maven-plugin generates incorrect package import for go-server
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
When using openapi-generator-maven-plugin to generate go-server codes, there are two errors in the generated codes:
(openapi-generator-version is 5.0.0)
"mime/multipart"is forget to import inrouter.go-
`github.com/gorilla/mux` should not be imported in `api_default.go` file.
How to produce:
I can stable reproduce it using the following file:
- get codes from: https://github.com/apache/iotdb/tree/openapi/openapi
- run
mvn generate-codes - the generated source is under
target/generated-sources/go
see the codes and error tips by GoLand.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce with the openapi-generator-maven-plugin using the IoTDB openapi directory and mvn generate-codes; inspect the generated target/generated-sources/go/router.go and api_default.go. The fix is complete when the generated go-server code no longer omits mime/multipart or imports github.com/gorilla/mux incorrectly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, java, openapi
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100