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

Spring Cloud Function can not deserealize mulitpart file types #597

Closed
SwapnilKhante opened this issue Oct 21, 2020 · 2 comments
Closed
Assignees
Milestone

Comments

@SwapnilKhante
Copy link

Describe the bug

Trying to write a function like following

  @Bean
  public Function <MultipartFile, String> uppercase() {
    return value -> value.getOriginalFilename();
  }

This function will be deployed as AWS lambda which will be triggered by API gateway. API gateway end point is exposing a post request with type multipart/form-data type.

Getting following error :

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: 
Cannot construct instance of org.springframework.web.multipart.MultipartFile` 
(no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, 
have custom deserializer, or contain additional type information

@SwapnilKhante
Copy link
Author

Hi, Is there any update on this issue ?

@olegz olegz self-assigned this Nov 9, 2020
@olegz olegz added this to the 3.1.0.RELEASE milestone Nov 9, 2020
@olegz olegz closed this as completed in 45520d3 Nov 9, 2020
@olegz
Copy link
Contributor

olegz commented Nov 9, 2020

The support for MultipartFile has been fixed. You can get more details from the two test cases that are part of the fix. Please let us know if you believe something is missing>

olegz added a commit that referenced this issue Apr 18, 2023
This initial fix ensures that functions can process single MultipartFile as well as multiple.

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

No branches or pull requests

2 participants