Skip to content

Form data being parsed with JSON mapper causes 500 #34660

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

Open
Dodomix opened this issue Mar 27, 2025 · 0 comments
Open

Form data being parsed with JSON mapper causes 500 #34660

Dodomix opened this issue Mar 27, 2025 · 0 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@Dodomix
Copy link

Dodomix commented Mar 27, 2025

Bug description

I'm having an issue with form data when using content type /. I managed to pinpoint it to this fix on Jackson Databind.
What happens now when initializing form data in DefaultServerWebExchange (code) is that JSON mappers also say they can read form data (here) and parsing therefore fails (because they can't).
Before this Jackson fix, ObjectMapper answered that it couldn't deserialize MultiValueMap.

Bug reproduce

Here is the simplest dummy app I've managed to build which replicates the issue: https://github.com/Dodomix/form-data-jackson-bug. The test fails with version 3.4.4 of Spring Boot, and passes with 3.4.3 (change in Jackson 2.18.2 -> 2.18.3). I'm opening the report here because the problematic code is in spring-web.

The exact behavior which changed in Jackson:

var objectMapper = new ObjectMapper();
objectMapper.canDeserialize(objectMapper.constructType(MultiValueMap.class));

Expected behavior

All tests pass.

System info

Java: Temurin 24

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 27, 2025
@jhoeller jhoeller added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

No branches or pull requests

3 participants