Open Tomer-L opened 9 months ago
Encountered this issue as well...
tested with the spec again and looks like the issue has been resolved
please give it a try with the latest master
friendly reminder: OpenAPI 3.1 support is still beta
Is this issue really resolved?
We face the same problem and I tried to test it with the latest master, but I still have the following line generated:
bodyParam := string{}
and the Invalid composite literal type error.
From what I see, this comes from controller-api.mustache on line 594
{{paramName}}Param := {{dataType}}{}
I don't really know how Mustache works, but I think there needs to be a special handling of literal types for body parameters?
what about using {{#isPrimitveType}} ... {{/isPrimitiveType}}
check ?
Bug Report Checklist
Description
Generating the following yaml spec you will get code that does not compile with the following errors:
Error 1: invalid composite literal type string
api_test_api.go on line 63
Expected code ->
Error 2: "github.com/gorilla/mux" imported and not used
Second compilation error is on file api_test_api.go line 17 There are at least 3 open issues:
8847
5153
11097
openapi-generator version
latest stable 7.1.0
OpenAPI declaration file content or url
Generation Details
I used the following command:
Steps to reproduce
Related issues/PRs
Could not find issues related to "invalid composite literal type string" error
Suggest a fix