OpenAPI file upload generates incorrect Api interface.
Closed this issue · 4 comments
TrisTronNL commented
Operation with a file upload generates incorrect Api interface.
openapi.yaml
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
see http://spec.openapis.org/oas/v3.0.3#considerations-for-file-uploads
Generated interface:
Object someOperation(@io.micronaut.http.annotation.Body File body);
The param should be of type byte[].
I hope this can get fixed because we need this in an application we're developing.
Thanks!
TrisTronNL commented
Or even better StreamingFileUpload / CompletedFileUpload, but I think these requires multipart/form-data.
sschnabe commented
I've implemented fileupload. Is this sufficient for your usecase?
TrisTronNL commented
Hi, thanks for the reply & fix! The MediatypeController.mediatypePostMultipart example is exactly what I was looking for. I'll test it next week with our openapi.yaml. Thanks again.