Open jacobshedenhelm-wk opened 1 year ago
please use --global-property skipFormModel=true
for the time being
the current/default behaviour aims to make the output backward-compatible with openapi 2.x
@wing328 Thanks for the response! Unfortunately, setting that property does not fix this issue. That global property you have suggested is needed to have the model actually get generated when using $ref, however, the issue I am reporting is actually in the generated handler for ReceiveCake
when it attempts to parse the Cake
object from the multipart/form-data
payload.
Bug Report Checklist
Description
Generating an endpoint that accepts a multipart/form-data payload with a non string property in the schema will result in a compilation error in the method.
In the example below, the generated interface method for
receiveCake
expects a number for theCake
parameter, however, the generated code parses the cake from the form payload as a string and passes the string into the method, thus resulting in a compiler error.openapi-generator version
openapitools/openapi-generator-cli:v6.6.0
andopenapitools/openapi-generator-cli:latest
OpenAPI declaration file content or url
Simplest:
The issue I am running into is when using a $ref, it also hits the same error.
Generation Details
openapigenerator-cli v6.6.0 & latest Golang
Note - you must set the global-property skipFormModel=true in order to generate the Cake model from the second oas provided, this is an open issue.
Steps to reproduce
use the open api generator to generate code from the top provided oas, navigate to the generated
ReceiveCake
method, notice compile error.Related issues/PRs
n/a