swagger-codegen-generators icon indicating copy to clipboard operation
swagger-codegen-generators copied to clipboard

php/api.mustache: Fix missing body decoding before deserialization

Open Padrio opened this issue 8 months ago • 0 comments

Fixes an issue where the response body was not decoded before attempting to deserialize it into a model when an exception (non-2xx HTTP response) occurs.

Previously, the raw response body stream was passed directly to the deserializer inside the ApiException handling block, which caused deserialization to fail for structured response types (e.g. JSON).

This patch ensures that the body content is read and decoded (JSON-decoded if applicable) before passing it to ObjectSerializer::deserialize(), mirroring the successful response handling logic.

Padrio avatar May 07 '25 17:05 Padrio