Content type 'multipart/form-data;boundary=----...;charset=UTF-8' not supported : <p>I want to send an object to the controller that has several lists with files and several fields with plain text.</p>

<pre><code>public class ContributionNew&lt;T extends MovieInfoDTO&gt; {
    private List&lt;T&gt; elementsToAdd;
    private Map&lt;Long, T&gt; elementsToUpdate;
    private Set&lt;Long&gt; idsToDelete;
    private Set&lt;String&gt; sources;
    private String comment;
}

public class Photo extends MovieInfoDTO {
    private MultipartFile photo;
}

@PostMapping(value = "/{id}/contributions/photos")
@ResponseStatus(HttpStatus.CREATED)
public
ResponseEntity&lt;Void&gt; createPhotoContribution(
        @ApiParam(value = "The movie ID", required = true)
        @PathVariable("id") final Long id,
        @ApiParam(value = "The contribution", required = true)
        @RequestBody @Valid final ContributionNew&lt;Photo&gt; contribution
) {
</code></pre>

<p>I am sending data using <a href="https://zapodaj.net/d22ba9788f302.png.html" rel="noreferrer">postman</a>. However, he throws me away</p>

<pre><code>org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'multipart/form-data;boundary=----WebKitFormBoundarywY7ByvgonAjDoaCT;charset=UTF-8' not supported
</code></pre>

<p>What should I set the Content-type for this controller so that I can send an object that has fields of plain text and lists with files?</p>

<p>If I set the header in the header</p>

<pre><code>Content-type: multipart/form-data; charset=utf-8
</code></pre>

<p>it throws me in the console</p>

<pre><code>org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found
</code></pre>
