Skip to content

Conversation

@Gautam-aman
Copy link

Issue

Invalid boolean values supplied to @RequestParam could result in
IllegalArgumentException escaping argument resolution, leading to
inconsistent error handling.

Changes

  • Catch and normalize IllegalArgumentException during argument conversion
  • Re-throw as MethodArgumentTypeMismatchException
  • Add regression test to RequestMappingHandlerAdapterTests

Result

Boolean request parameter conversion errors are now handled consistently
with other type mismatches.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 22, 2025
Signed-off-by: Aman Gautam <amangautam2128@gmail.com>
@Gautam-aman Gautam-aman force-pushed the fix/boolean-requestparam-bad-request branch from ba4d0e3 to a5e781f Compare December 22, 2025 20:43
@bclozel
Copy link
Member

bclozel commented Dec 23, 2025

See #36061 (comment)

@bclozel bclozel closed this Dec 23, 2025
@bclozel bclozel added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants