[GH-ISSUE #4941] [bug]: query parameter array doesn't work #1869

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

Originally created by @NicolasR on GitHub (Mar 26, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4941

Originally assigned to: @anwarulislam on GitHub.

Is there an existing issue for this?

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

Current behavior

Hi,

When i try to use an array query parameter, only last value is taken in account.

Steps to reproduce

  1. Go to query form
  2. Go to Parameters tab
  3. Add parameter Pony with value 1
  4. Add parameter Pony with value 2

Only last value is taken in account.

Logs and Screenshots


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 @NicolasR on GitHub (Mar 26, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4941 Originally assigned to: @anwarulislam 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 Hi, When i try to use an array query parameter, only last value is taken in account. ### Steps to reproduce 1. Go to query form 2. Go to **Parameters** tab 3. Add parameter **Pony** with value **1** 4. Add parameter **Pony** with value **2** Only last value is taken in account. ### Logs and Screenshots ```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:10:47 +03:00
Author
Owner

@liyasthomas commented on GitHub (Mar 26, 2025):

When you have two parameters with the same key in a query string or request, only the last value for that key will be retained.

<!-- gh-comment-id:2754979241 --> @liyasthomas commented on GitHub (Mar 26, 2025): When you have two parameters with the same key in a query string or request, only the last value for that key will be retained.
Author
Owner

@NicolasR commented on GitHub (Mar 26, 2025):

If i put directly in the url field: http://myapi?pony=1&pony=2 it works. It doesn't if i use the parameters form.
Is it by design or is it a bug ?

<!-- gh-comment-id:2755002267 --> @NicolasR commented on GitHub (Mar 26, 2025): If i put directly in the url field: http://myapi?pony=1&pony=2 it works. It doesn't if i use the parameters form. Is it by design or is it a bug ?
Author
Owner

@liyasthomas commented on GitHub (Mar 26, 2025):

@anwarulislam can you look into this. I think the behaviour should be consistent across both scenarios: passing arguments via URL and Parameters tab.

<!-- gh-comment-id:2755054966 --> @liyasthomas commented on GitHub (Mar 26, 2025): @anwarulislam can you look into this. I think the behaviour should be consistent across both scenarios: passing arguments via URL and Parameters tab.
Author
Owner

@anwarulislam commented on GitHub (Mar 26, 2025):

@liyasthomas I'm looking into this.

<!-- gh-comment-id:2755146488 --> @anwarulislam commented on GitHub (Mar 26, 2025): @liyasthomas I'm looking into this.
Author
Owner

@NZetterval commented on GitHub (Apr 9, 2025):

I also have noticed this bug, it have worked before. A related thing is that the generate code adds a [n] after the query parameter that it not should do.
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

<!-- gh-comment-id:2788729520 --> @NZetterval commented on GitHub (Apr 9, 2025): I also have noticed this bug, it have worked before. A related thing is that the generate code adds a [n] after the query parameter that it not should do. 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
Author
Owner

@anwarulislam commented on GitHub (Apr 9, 2025):

Hi @NZetterval!
Thanks for informing us of the related issue.

<!-- gh-comment-id:2788807560 --> @anwarulislam commented on GitHub (Apr 9, 2025): Hi @NZetterval! Thanks for informing us of the related issue.
Author
Owner

@jamesgeorge007 commented on GitHub (Apr 11, 2025):

I also have noticed this bug, it have worked before. A related thing is that the generate code adds a [n] after the query parameter that it not should do. 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

Could you open an issue so that we can track this separately?

<!-- gh-comment-id:2796139274 --> @jamesgeorge007 commented on GitHub (Apr 11, 2025): > I also have noticed this bug, it have worked before. A related thing is that the generate code adds a [n] after the query parameter that it not should do. Example) Generates: curl --request GET --url '[https://api.example.com/v1/iot-subscriptions/?include[0]=health&include[1]=variables&include[2]=enablementHardware](https://api.example.com/v1/iot-subscriptions/?include%5B0%5D=health&include%5B1%5D=variables&include%5B2%5D=enablementHardware) Should be: curl --request GET --url 'https://api.example.com/v1/iot-subscriptions/?include=health&include=variables&include=enablementHardware Could you open an issue so that we can track this separately?
Author
Owner

@jamesgeorge007 commented on GitHub (Apr 11, 2025):

Closing this issue since it is addressed in the latest release. Please feel free to let us know if you have any feedback.

<!-- gh-comment-id:2796140685 --> @jamesgeorge007 commented on GitHub (Apr 11, 2025): Closing this issue since it is addressed in the latest release. Please feel free to let us know if you have any feedback.
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#1869
No description provided.