Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Padrio
Copy link

@Padrio Padrio commented May 7, 2025

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.

…r exception

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant