[GH-ISSUE #5088] [bug]: duplicate query parameters are not handled by curl request generation #1933

Closed
opened 2026-03-16 22:25:47 +03:00 by kerem · 8 comments
Owner

Originally created by @garethjudson on GitHub (May 21, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5088

Is there an existing issue for this?

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

Current behavior

When I create a request with duplicate query parameter names, e.g.:

Image

When I generate a curl request using 'show code', the request includes indexing, rather than just repeating the parameter:

Image

curl --request GET \
  --url 'https://echo.hoppscotch.io/?test[0]=a&test[1]=b&test[2]=c'

Expected result would be to repeat the query parameter verbatim, not add indexing:

curl --request GET \
  --url 'https://echo.hoppscotch.io/?test=a&test=b&test=c'

Steps to reproduce

  1. Enter a url into a get request
  2. add query parameters in the 'parameters tab' with duplicate keys
  3. on the send button, click the drop down arrow, choose 'show code'
  4. choose 'shell - cURL'

Logs and Screenshots

Image

Image

Environment

Production

Hoppscotch Version

Cloud
Version 25.4.2 (20250508.111240)

Interceptor

Not Applicable - Issue not related to network requests

Browsers Affected

No response

Operating System

MacOS

Additional Information

No response

Originally created by @garethjudson on GitHub (May 21, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5088 ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Current behavior When I create a request with duplicate query parameter names, e.g.: ![Image](https://github.com/user-attachments/assets/8f8cc81c-f23d-4e28-9e36-85436bdc0b02) When I generate a curl request using 'show code', the request includes indexing, rather than just repeating the parameter: ![Image](https://github.com/user-attachments/assets/087aea21-c589-44f0-94c4-f47f5a1feb92) ``` curl --request GET \ --url 'https://echo.hoppscotch.io/?test[0]=a&test[1]=b&test[2]=c' ``` Expected result would be to repeat the query parameter verbatim, not add indexing: ``` curl --request GET \ --url 'https://echo.hoppscotch.io/?test=a&test=b&test=c' ``` ### Steps to reproduce 1. Enter a url into a get request 2. add query parameters in the 'parameters tab' with duplicate keys 3. on the send button, click the drop down arrow, choose 'show code' 4. choose 'shell - cURL' ### Logs and Screenshots ![Image](https://github.com/user-attachments/assets/8f8cc81c-f23d-4e28-9e36-85436bdc0b02) ![Image](https://github.com/user-attachments/assets/087aea21-c589-44f0-94c4-f47f5a1feb92) ### Environment Production ### Hoppscotch Version Cloud Version 25.4.2 (20250508.111240) ### Interceptor Not Applicable - Issue not related to network requests ### Browsers Affected _No response_ ### Operating System MacOS ### Additional Information _No response_
kerem 2026-03-16 22:25:47 +03:00
Author
Owner

@arifmohammad30 commented on GitHub (May 21, 2025):

I'd like to work on this. Planning to change the cURL generator to use repeated keys instead of indexed arrays. Let me know if that’s okay.

<!-- gh-comment-id:2896460934 --> @arifmohammad30 commented on GitHub (May 21, 2025): I'd like to work on this. Planning to change the cURL generator to use repeated keys instead of indexed arrays. Let me know if that’s okay.
Author
Owner

@soumyamakkar commented on GitHub (Jun 23, 2025):

Can I be assigned this issue?

<!-- gh-comment-id:2994992716 --> @soumyamakkar commented on GitHub (Jun 23, 2025): Can I be assigned this issue?
Author
Owner

@liyasthomas commented on GitHub (Jun 23, 2025):

If @arifmohammad30 isn’t working on this, you can give it a try, @soumyamakkar. I’d be happy to review a PR.

<!-- gh-comment-id:2995050697 --> @liyasthomas commented on GitHub (Jun 23, 2025): If @arifmohammad30 isn’t working on this, you can give it a try, @soumyamakkar. I’d be happy to review a PR.
Author
Owner

@soumyamakkar commented on GitHub (Jun 24, 2025):

its happening because of http snippet's default behavior of indexing duplicate query params... will it be ok to replace it with a manually built cURL command?

<!-- gh-comment-id:3000020124 --> @soumyamakkar commented on GitHub (Jun 24, 2025): its happening because of http snippet's default behavior of indexing duplicate query params... will it be ok to replace it with a manually built cURL command?
Author
Owner

@rafalaidlaw commented on GitHub (Jun 29, 2025):

@liyasthomas can you assign this to me? @soumyamakkar Are you working on this?

<!-- gh-comment-id:3017174670 --> @rafalaidlaw commented on GitHub (Jun 29, 2025): @liyasthomas can you assign this to me? @soumyamakkar Are you working on this?
Author
Owner

@soumyamakkar commented on GitHub (Jun 30, 2025):

yes i am working on this.

<!-- gh-comment-id:3017784355 --> @soumyamakkar commented on GitHub (Jun 30, 2025): yes i am working on this.
Author
Owner

@Manasvisharma09 commented on GitHub (Jul 23, 2025):

Hi! I want to work on this 🙂

<!-- gh-comment-id:3109162203 --> @Manasvisharma09 commented on GitHub (Jul 23, 2025): Hi! I want to work on this 🙂
Author
Owner

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

Hi, closing this issue since it's addressed in the latest release.
Addressed via https://github.com/hoppscotch/httpsnippet/pull/5.

<!-- gh-comment-id:3139410863 --> @jamesgeorge007 commented on GitHub (Jul 31, 2025): Hi, closing this issue since it's addressed in the latest release. Addressed via https://github.com/hoppscotch/httpsnippet/pull/5.
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#1933
No description provided.