OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
[x] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
A generated Golang client for an OpenAPI 3 spec that includes multi-file uploads fails to build because the array of files is generated as a single file. For example, the following snippet is from the generated api_default.go:
I'm willing to pay $100 for a quick fix on this and $150 if there's a subsequent v5.0.1 patch release with the fix (both for home-brew and the Docker image).
Bug Report Checklist
Description
A generated Golang client for an OpenAPI 3 spec that includes multi-file uploads fails to build because the array of files is generated as a single file. For example, the following snippet is from the generated
api_default.go
:openapi-generator version
I have tried with the following versions:
OpenAPI declaration file content or url
Generation Details
The
generator-template
directory contains a single file,partial_header.mustache
:Steps to reproduce
Switch to a temporary directory:
Create a spec file:
Create a generator template:
Generate the Golang code using the Open API Docker image:
Print lines 106-116 of
api_default.go
to see the incorrectly generated client:I imagine the same lines should treat the property as a slice/collection similar to the related issue in the next section.
Related issues/PRs
The following issue and PR seemed promising:
However, it seems the fix was for the server-side handling only.
Suggest a fix
Issue https://github.com/OpenAPITools/openapi-generator/issues/8104 seems to be the same as this one, but for typescript. I believe the same fix, but for Go, should work.
Sponsorship
I'm willing to pay $100 for a quick fix on this and $150 if there's a subsequent v5.0.1 patch release with the fix (both for home-brew and the Docker image).