This repository was archived by the owner on Dec 31, 2024. It is now read-only.
Closed
Conversation
Author
|
Moved the PR to spring-cloud/spring-cloud-openfeign#314 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm using Spring Cloud OpenFeign, and I have a use case where I need to send multiple files and POJOs as
multipart/form-data, for example:There was a recent fix in spring-cloud/spring-cloud-openfeign#258 that allowed the use of multiple
@RequestParts, but it was only forMultipartFileand boxed primitive types. This PR builds on the abovementioned PR by:pom.xmlto enjoy the benefits of the abovementioned PRPojoSerializationWriterthat can serialize POJOs to some string; in the unit tests I use Jackson to serialize as JSONSpringFormEncoderto (optionally) usePojoSerializationWriterSpringFormEncoder.encode()by removing code that is unnecessary due to Fix GH-201: Multiple @RequestPart not Working spring-cloud/spring-cloud-openfeign#258 already doing the conversion to Map (except for one if-clause for@ResponseBody MultipartFile)@RequestParts to have avalue@RequestParts: collections, arrays,MultipartFile, etc.With this PR, pull requests #71 and #74 are also no longer necessary.