OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.74k stars 6.32k forks source link

Openapi-generator-maven-plugin not able to generate objects for multipart/form-data request #13288

Open RomioSahoo opened 1 year ago

RomioSahoo commented 1 year ago

Bug Report Checklist

Description

Models not generated for multipart/form-data request using openapi-generator-maven-plugin

openapi-generator version

openapi-generator 6x

OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

Not a fix but has a workaroud. By default skipFormModel is true need to explicitly make it false Tried out using a workaround from https://github.com/OpenAPITools/openapi-generator/issues/10415#issuecomment-1003067496 and it fixes the issue, but still, it is a workaround and not default behavior

TeHMoroS commented 7 months ago

This still seems the issue. The workaround seems to generate the models, but the generators ignore them completely (still require seperate parameters instead of a single object).

Messages go from: Model XYZ not generated since it's marked as unused (due to form parameters) and 'skipFormModel' (global property) set to true (default) to: Model XYZ(marked as unused due to form parameters) is generated due to the global property 'skipFormModel' set to false

Generator Maven plugin version 7.1.0. Generators used: spring with spring-boot library (or spring-cloud) and java with webclient for multipart/form-data.