Closed giovanabartholomeu closed 2 months ago
you are wrong, there is a way to do it. Just add type mapping via gradle plugin like this:
openapi {
server(file("swagger.yml")) {
useReactive = false
typeMapping = [
file : "StreamingFileUpload"
]
}
}
Well, I use Maven instead of Gradle, so it only worked for me when I did it this way:
multipart/form-data:
schema:
type: object
properties:
file:
type: StreamingFileUpload
format: binary
I didn’t need to import anything :) thanks
@giovanabartholomeu
Got it. Well, I've added support for all the generator's features to the maven plugin. Wait for the next release of the plugin, after that you'll be able to add mapping like in the gradle:
<plugin>
<groupId>io.micronaut.maven</groupId>
<artifactId>micronaut-maven-plugin</artifactId>
<version>${micronaut-maven-plugin.version}</version>
<configuration>
<lombok>true</lombok>
<typeMapping>
<file>StreamingFileUpload</file>
</typeMapping>
</configuration>
</plugin>
https://github.com/micronaut-projects/micronaut-maven-plugin/pull/1185
Issue description
Swagger-codegen version 3.0.1
Description When I generate a yaml to receive a file from the controller, by default it generates the CompletedFileUpload parameter:
Generated interface:
Controller implements:
But, I would like to upload files using StreamingFileUpload. How should I reference it in my yaml so that the generated parameter is a StreamingFileUpload and not a CompletedFileUpload?