[GH-ISSUE #5001] [bug]: Show code adds index on query parameter if more than one with same name #1902

Closed
opened 2026-03-16 22:18:51 +03:00 by kerem · 3 comments
Owner

Originally created by @NZetterval on GitHub (Apr 16, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5001

Originally assigned to: @SharadSaha on GitHub.

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Current behavior

Show code of request when more than one query parameter with same name adds an index. Should not do that. See below example:

Generates:
curl --request GET
--url 'https://api.example.com/v1/iot-subscriptions/?include[0]=health&include[1]=variables&include[2]=enablementHardware'

Should be:
curl --request GET
--url 'https://api.example.com/v1/iot-subscriptions/?include=health&include=variables&include=enablementHardware'

Steps to reproduce

  1. Create a request
  2. Add query parameter
  3. Add one more query parameter with same name
  4. Choose to show code

Logs and Screenshots

Image


Environment

Production

Hoppscotch Version

Cloud

Interceptor

Not Applicable - Issue not related to network requests

Browsers Affected

No response

Operating System

None

Additional Information

No response

Originally created by @NZetterval on GitHub (Apr 16, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5001 Originally assigned to: @SharadSaha on GitHub. ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Current behavior Show code of request when more than one query parameter with same name adds an index. Should not do that. See below example: Generates: curl --request GET --url 'https://api.example.com/v1/iot-subscriptions/?include[0]=health&include[1]=variables&include[2]=enablementHardware' Should be: curl --request GET --url 'https://api.example.com/v1/iot-subscriptions/?include=health&include=variables&include=enablementHardware' ### Steps to reproduce 1. Create a request 2. Add query parameter 3. Add one more query parameter with same name 4. Choose to show code ### Logs and Screenshots ![Image](https://github.com/user-attachments/assets/70a5a60a-2486-45dd-9a71-9f2942fa94a9) ```shell ``` ### Environment Production ### Hoppscotch Version Cloud ### Interceptor Not Applicable - Issue not related to network requests ### Browsers Affected _No response_ ### Operating System None ### Additional Information _No response_
kerem 2026-03-16 22:18:51 +03:00
Author
Owner

@SharadSaha commented on GitHub (Jul 5, 2025):

Hi, I have been following this issue, and would love to open a PR to resolve this. Please assign this to me.

<!-- gh-comment-id:3038677905 --> @SharadSaha commented on GitHub (Jul 5, 2025): Hi, I have been following this issue, and would love to open a PR to resolve this. Please assign this to me.
Author
Owner

@SharadSaha commented on GitHub (Jul 5, 2025):

@liyasthomas Seems like this is an issue with httpsnippet itself, I have identified the issue as well, I would like to raise a PR against https://github.com/hoppscotch/httpsnippet. Please let me know if that is the approach to take.

PR : https://github.com/hoppscotch/httpsnippet/pull/5

<!-- gh-comment-id:3038792870 --> @SharadSaha commented on GitHub (Jul 5, 2025): @liyasthomas Seems like this is an issue with httpsnippet itself, I have identified the issue as well, I would like to raise a PR against [https://github.com/hoppscotch/httpsnippet](url). Please let me know if that is the approach to take. PR : [https://github.com/hoppscotch/httpsnippet/pull/5](url)
Author
Owner

@jamesgeorge007 commented on GitHub (Jul 31, 2025):

Hi, closing this issue since it's resolved in the latest release.

<!-- gh-comment-id:3139398128 --> @jamesgeorge007 commented on GitHub (Jul 31, 2025): Hi, closing this issue since it's resolved in the latest release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1902
No description provided.