Open b0m123 opened 2 months ago
Hi @b0m123,
I can confirm that requests with multipart/form-data
does not currently lead to working code being generated.
This applies to the OkHttp
client as well as the controller interfaces for Micronaut, Spring and Ktor
For OkHttp
we will need to generate specific code for multipart requests. This recipe from OkHttp describes how to do it.
One possible cause of action would be to add a special case to the request statement builder for operation.requestBody.getPrimaryContentMediaType()?.key == "multipart/form-data"
, which would construct the requestBody
using OkHttp's MultipartBody.Builder()
.
Hi, I have a question whether Multipart requests are supported? (see https://swagger.io/docs/specification/describing-request-body/multipart-requests/) I'm trying to generate simple OkHttp client with model (here is my endpoint in openapi.yaml as example)
but I'm facing an error
Unresolved reference 'MultipartFormData'.
To be clear I'm using fabrikt-gradle-plugin with this config
Thanks in advance for any support