kokuwaio/micronaut-openapi-codegen

OpenAPI file upload generates incorrect Api interface.

Closed this issue · 4 comments

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!

Or even better StreamingFileUpload / CompletedFileUpload, but I think these requires multipart/form-data.

I've implemented fileupload. Is this sufficient for your usecase?

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.

Please try version 1.6.3.