This repository has been archived by the owner on Dec 31, 2024. It is now read-only.
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
@RequestPart
s, but it was only forMultipartFile
and boxed primitive types. This PR builds on the abovementioned PR by:pom.xml
to enjoy the benefits of the abovementioned PRPojoSerializationWriter
that can serialize POJOs to some string; in the unit tests I use Jackson to serialize as JSONSpringFormEncoder
to (optionally) usePojoSerializationWriter
SpringFormEncoder.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
)@RequestPart
s to have avalue
@RequestPart
s: collections, arrays,MultipartFile
, etc.With this PR, pull requests #71 and #74 are also no longer necessary.