OpenAPITools / OpenAPITools/openapi-generator
Question: how to generate MultipartFile for binary string
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
Hi, can you, please, help me generate array/collection of org.springframework.web.multipart.MultipartFile for files array:
type: array
items:
type: string
format: binary
Currently I only get collection of org.springframework.core.io.Resource. I tried typeMappings/importMappings/mustache templates, but w/o success.
I've created question regarding this problem on stackoverflow: https://stackoverflow.com/questions/73107663/how-to-generate-multipartfile-for-binary-string-by-openapitools.
openapi-generator version
openapi-generator-cli:5.0.1
OpenAPI declaration file content or url
{
"generatorName": "spring",
"library": "spring-cloud",
"hideGenerationTimestamp": true,
"globalProperties": {
"skipFormModel": false
},
"openApiNullable": false,
"java8": true,
"jsr310": true
}
Command line used for generation
gradle file:
swaggerSources {
assetApi {
inputFile = file('swagger/api.yaml')
code {
language = 'spring'
configFile = file("swagger/config.json")
components = ['models': true, 'apis': true]
templateDir = file('templates/java')
}
}
}
Steps to reproduce
N/A
Related issues/PRs
N/A
Suggest a fix/enhancement
If there's solution of this problem, probably it should be added to project's readme.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied OpenAPI binary-array declaration, the Spring generator configuration, and the custom templates/java directory; compare the generated Resource collection with the requested MultipartFile collection. Determine whether the mapping is supported, then document the confirmed configuration or limitation in the project README.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, spring
- Domain
- api, backend, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100