Skip to content

Conversion not applied to @RequestParam default value if used for "null after conversion" case #31336

Closed
@martin-mfg

Description

@martin-mfg

Affects: 6.0.12 and older versions


When specifying a defaultValue for a request parameter, my understanding is that the request parameter should never be null. However, providing e.g. a whitespace character (%20) for a Boolean parameter results in a null value.

I've created a small reproducible example here.

When using the latest Spring version 6.1.0-M5, I don't get a null value anymore. Instead, Spring returns an HTTP status code 500. While this behaviour is different, I think it's still not what should happen. I would expect a status code 400 - or maybe a 200 with the Boolean parameter set to its default value.

I also found this similar issue from 2013: #14813

Looking forward to a fix :)

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