Closed
Description
Symfony version(s) affected: 4.4.12
Description
I am using the HTTP client to query a third party API. I am making a call that results in a 400 Bad Request response, and the response looks like this:
{
"type": "validation_error",
"detail": {
"invalid_field_name": ["Reasons this field is invalid"]
}
}
However the HTTP Client sees the detail property and assumes the response is in RFC 7807 format, and attempts to concatenate the detail with other strings.
The detail property is an object which causes an Array to string conversion
error, preventing the response from being returned to application code.
How to reproduce
Use HTTP Client to make a request that results in a 400 Bad Request
response, and returns a json payload with a non-scalar title
or detail
property.