zalando / problem-spring-web

A library for handling Problems in Spring Web MVC
MIT License
1.04k stars 126 forks source link

problem-spring-webflux issue with invalid request body after upgrading to Spring Boot 3 (BAD REQUEST) #940

Open muhammad-hamed opened 1 year ago

muhammad-hamed commented 1 year ago

Description

After upgrading to Spring Boot 3.1.4, there's a bug related to missing information from the request body. Here's a project debug-zalando-problem-spring-boot-3. The project has a test case that succeeds with the Spring-boot 2.7.14 while it fails with Spring Boot 3.

Expected Behavior

When we send a request body with a missing field we expect that the problem detail contains value failed for JSON property property_name due to missing

Actual Behavior

The problem detail being returned is 400 BAD_REQUEST "Failed to read HTTP message" it does not contain the relevant information about the issue with the request body.

Possible Fix

Steps to Reproduce

  1. debug-zalando-problem-spring-boot-3 contains a unit test for reproducing.
  2. The unit test is working fine with problem-spring-webflux and version: 0.27.0 and Spring Boot version2.7.16`

Context

A generic error message will be returned by The affected service. e.g. if customer context was missing from the request body, the returned problem detail will be 400 BAD_REQUEST "Failed to read HTTP message". The expected response problem details should have failed for JSON property customer_context due to missing. So in case there are any kind of issues related to the request body, it will be hard to figure out the reason (Specifically in case of incidents).

Your Environment

sivagnanavelu commented 7 months ago

I am also facing the same issue. It is resolved?