Bug Report Checklist
Description
I want to build a rest-service which needs to be able to support large-ish file uploads. I am using spring-boot 2.2.7.RELEASE with webflux.
openapi-generator version
openapi-generator-maven-plugin v4.3.1.
OpenAPI declaration file content or url
/upload/{parentId}/doc:
post:
tags:
- docs
summary: uploads a new document
operationId: upload.doc
security:
- bearerAuth: []
parameters:
- in: path
name: parentId
schema:
type: string
required: true
requestBody:
content:
multipart/form-data:
schema:
type: object
properties:
file:
type: string
format: binary
responses:
201:
description: upload was succesfull
Command line used for generation
I am using it directly in my pom.xml file as follows:
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>${openapi-generator.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/swagger.yaml</inputSpec>
<modelPackage>com.application.rest.models</modelPackage>
<apiPackage>com.application.rest</apiPackage>
<library>spring-boot</library>
<generatorName>spring</generatorName>
<modelNamePrefix>Rest</modelNamePrefix>
<generateSupportingFiles>true</generateSupportingFiles>
<configOptions>
<interfaceOnly>true</interfaceOnly>
<serializableModel>true</serializableModel>
<invokerPackage>com.application</invokerPackage>
<basePackage>com.application.backend</basePackage>
<configPackage>com.application.conf</configPackage>
<dateLibrary>java8</dateLibrary>
<delegatePattern>false</delegatePattern>
<useOptional>true</useOptional>
<sourceFolder>src/main/java</sourceFolder>
<reactive>true</reactive>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
Steps to reproduce
In the maven-java directory, simply run mvn clean compile.
Related issues/PRs
Suggest a fix
The correct parameter should be Flux<Part> or Flux<FilePart>. There are several examples:
Simply using MultipartFile forces us to go through InputStream and then handle blocking calls (like close, for instance) from non-blocking code.
Bug Report Checklist
Description
I want to build a rest-service which needs to be able to support large-ish file uploads. I am using spring-boot 2.2.7.RELEASE with webflux.
openapi-generator version
openapi-generator-maven-pluginv4.3.1.OpenAPI declaration file content or url
Command line used for generation
I am using it directly in my
pom.xmlfile as follows:Steps to reproduce
In the maven-java directory, simply run
mvn clean compile.Related issues/PRs
Suggest a fix
The correct parameter should be
Flux<Part>orFlux<FilePart>. There are several examples:Simply using
MultipartFileforces us to go through InputStream and then handle blocking calls (likeclose, for instance) from non-blocking code.