Skip to content

Conversation

@Spydarlee
Copy link
Contributor

Me again 😅

I noticed that the Giantbomb API wasn't always returning results, even for things I knew were definitely in their database. Manually querying the API returned results as expected, so I did some digging.

It looks like openapi-fetch encodes query parameters automatically, so the manual call to encodeURIComponent was doubling up. For example, searching for "A Short Hike" generated this URL for the query:

https://www.giantbomb.com/api/games?api_key={REDACTED}&filter=name%3AA%2520Short%2520Hike&format=json&limit=20

Whereas what we want (%20 for spaces, not %2520) is:

https://www.giantbomb.com/api/games?api_key={REDACTED}&filter=name%3AA%20Short%20Hike&format=json&limit=20

Which is what gets generated with this little fix in place.

image

@mProjectsCode mProjectsCode merged commit 810beaa into mProjectsCode:master Aug 30, 2025
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