1

can you, please, help me generate array/collection of org.springframework.web.multipart.MultipartFile for files array:

type: array
items:
  type: string
  format: binary

Framework which is used: openapigenerator-cli by openapitools v.5.

Currently I only get collection of org.springframework.core.io.Resource. I tried typeMappings/importMappings/mustache templates, but w/o success.

Here's library file for Spring code generation: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java.

Niko
  • 21
  • 3

1 Answers1

0

The following workaround was used: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/Java/pojo.mustache with {{{datatypeWithEnum}}} replaced with {{#isFile}}MultipartFile{{/isFile}}{{^isFile}}{{{datatypeWithEnum}}}{{/isFile}}, so files will be represented by given type after work of openapi-generator.

Niko
  • 21
  • 3