Skip to content

fix: decode OpenLibrary author response before accessing fields #519

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

Merged
merged 1 commit into from
Apr 18, 2025

Conversation

yaposmihayus
Copy link
Contributor

Q A
Branch? 4.1
Tickets N/A
License MIT
Doc PR N/A

The author response from the OpenLibrary API was being treated as an array, but HttpClientInterface::request() returns a ResponseInterface. This caused a fatal error when trying to access $author['name'].

Now the response content is properly decoded before accessing the 'name' field.

The author response from the OpenLibrary API was being treated as an array, but HttpClientInterface::request() returns a ResponseInterface. This caused a fatal error when trying to access `$author['name']`.

Now the response content is properly decoded before accessing the 'name' field.
Copy link
Contributor

@vincentchalamon vincentchalamon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thank you very much!

@vincentchalamon vincentchalamon merged commit c156ecf into api-platform:4.1 Apr 18, 2025
10 of 12 checks passed
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.

2 participants