Skip to content

Align @RequestPart support in WebFlux with Spring MVC #22973

Description

@andrej-urvantsev

Affects: 5.1.6


After upgrading Spring Boot from 2.0.2 to 2.1.4 we started to see an issue with multipart form data uploading:

@PostMapping(value = "/{id}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public Mono<Void> store(@PathVariable final String id,
        @RequestPart("metadata") final Map<String, String> metadata,
        @RequestPart("fieldOne") final List<String> fieldOne,
        @RequestPart("fieldTwo") final List<Double> fieldTwo)

That worked on spring boot 2.0.2, but on 2.1.4 it fails with decoding exception:

Cannot deserialize instance of `java.lang.Double` out of START_ARRAY token

So it actually tries to deserialize list of doubles as just a Double.

As a workaround we've changed method signature to use Double[] instead of List. After that it works as expected.

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions