Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.springframework.core.io.Resource cannot be converted to org.springframework.web.multipart.MultipartFile #18345

Closed
siddhsql opened this issue Apr 9, 2024 · 1 comment · Fixed by #18509

Comments

@siddhsql
Copy link

siddhsql commented Apr 9, 2024

I get above error when trying to generate Java stub using the sample OpenAPI spec found at https://editor.swagger.io/

mre.zip

Steps to Repro

  1. unzip the MRE
  2. mvn clean install

Expected

no errors

Observed

[ERROR] /Users/xxx/code/openapi-mre/target/generated-sources/openapi/src/main/java/com/baeldung/openapi/api/PetApi.java:[340,68] incompatible types: org.springframework.core.io.Resource cannot be converted to org.springframework.web.multipart.MultipartFile

how can I fix this? is this a bug or something that i am doing wrong?

@moipcr
Copy link

moipcr commented Apr 19, 2024

Like you. Same error in 7.5.0 version and previous. With Spring Boot 3.2.4 and use option spring boot 3.x in maven plugin.

My spec is:

openapi: "3.1.0" info: version: 1.0.0 title: ApiRest paths: /files/retrieve: post: summary: Retrieve a file operationId: retrieveFile tags: - File requestBody: required: true content: application/octet-stream: schema: type: string format: binary responses: '201': description: OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants