Open whiemstra opened 3 years ago
Just ran into this myself and was able to resolve.
--global-property skipFormModel=true
fixes the issue
I'm using npm package "@openapitools/openapi-generator-cli": "2.4.2",
openapitools.json
file looks like this:
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "5.2.0",
"generators": {
"standard": {
"generatorName": "typescript-axios",
"output": "#{cwd}/src/api/generated-files",
"glob": "openapi.yaml",
"skipValidateSpec": true,
"additionalProperties": {
"supportsEs6": "true",
"useSingleRequestParameter": true
},
"globalProperty": {
"skipFormModel": false
}
}
}
}
}
Amazing, that is a fix indeed thx @sensi-shane! But is this the desired behavior?
@whiemstra you're welcome! I believe so. I found it on this page of docs. You can do a search on the page for skipFormModel
https://openapi-generator.tech/docs/customization/
Bug Report Checklist
Description
When using openApiGenerate with a yaml, model is not generated when used as a $ref inside a multipart/form-data requestBody.
If multipart/form-data is changed to application/json, the model will be generated.
openapi-generator version
5.2.0
OpenAPI declaration file content or url
Generation Details
Gradle: 7.2 Kotlin: 1.5.30 Java: 11
Also tested with: SerializationLibrary: jackson (2.12.3)
Steps to reproduce
Create a gradle file with dependencies and the org.openapi.generator plugin
Execute: gradle openApiGenerate