Skip to content

Conversation

@aleksej-axiology
Copy link

@aleksej-axiology aleksej-axiology commented Mar 3, 2025

Note

Enhances query serialization to handle objects and arrays using bracketed keys (key[index]/key[subkey]) in fetch-http-client.ejs.

  • HTTP Client Template (templates/base/http-clients/fetch-http-client.ejs):
    • Query serialization:
      • addArrayQueryParam: now serializes arrays as key[index]=value and objects via Object.entries, emitting key[subkey]=value.
      • toQueryString: treats both objects and arrays as complex params, delegating to addArrayQueryParam; primitives use addQueryParam.

Written by Cursor Bugbot for commit a8851f7. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Mar 3, 2025

⚠️ No Changeset found

Latest commit: a8851f7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@smorimoto smorimoto added the enhancement New feature or request label Mar 24, 2025
@herman-axiology herman-axiology force-pushed the feat/objects-support-in-query-params branch from 91b106f to a8851f7 Compare June 10, 2025 07:54
@smorimoto
Copy link
Collaborator

bugbot run

.join("&");
.map((key) =>
typeof query[key] === "object" || Array.isArray(query[key])
? this.addArrayQueryParam(query, key)
Copy link

Choose a reason for hiding this comment

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

Bug: Null Handling Error in Query String Method

The toQueryString method incorrectly treats null values as objects, causing addArrayQueryParam to receive null. This results in a TypeError when Object.entries(null) is called.

Fix in Cursor Fix in Web

@herman-axiology
Copy link

Thank you for looking at this @smorimoto 🙇‍♂️

Do you think this could get accepted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants