[GH-ISSUE #891] Handle JSON Parameter list validation #312

Closed
opened 2026-03-16 14:38:29 +03:00 by kerem · 8 comments
Owner

Originally created by @someshkar on GitHub (May 21, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/891

Originally assigned to: @liyasthomas on GitHub.

Is your feature request related to a problem? Please describe.
The ability to add and remove fields when POSTing JSON bodies to an API is only limited to key value pairs. When trying to POST data to a REST API which consumes a JSON array, I don't see a clear way to do this. The JSON body looks like this:

{
	"domains": ["google.com", "facebook.com"]
}

Describe the solution you'd like
I'd like to be able to add an array as the value of a key in the JSON body.

Describe alternatives you've considered
One good solution would be having sub entries under one key-value pair in the UI.

Additional context
This is what currently happens when I try to use an array as a key-value pair in the JSON body:

image

And attempting to use single quotes just results in the array getting converted to a string on it's own:

image

Originally created by @someshkar on GitHub (May 21, 2020). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/891 Originally assigned to: @liyasthomas on GitHub. **Is your feature request related to a problem? Please describe.** The ability to add and remove fields when POSTing JSON bodies to an API is only limited to key value pairs. When trying to POST data to a REST API which consumes a JSON array, I don't see a clear way to do this. The JSON body looks like this: ```json { "domains": ["google.com", "facebook.com"] } ``` **Describe the solution you'd like** I'd like to be able to add an array as the value of a key in the JSON body. **Describe alternatives you've considered** One good solution would be having sub entries under one key-value pair in the UI. **Additional context** This is what currently happens when I try to use an array as a key-value pair in the JSON body: ![image](https://user-images.githubusercontent.com/14039437/82537839-53059400-9b68-11ea-90cc-ffa8252bf8ac.png) And attempting to use single quotes just results in the array getting converted to a string on it's own: ![image](https://user-images.githubusercontent.com/14039437/82537963-93651200-9b68-11ea-8abf-f8eeba757401.png)
kerem 2026-03-16 14:38:29 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@AndrewBastin commented on GitHub (May 21, 2020):

@someshkar Thank you for opening the issue.

We will look into the issue ASAP.

For now, I suggest you use the Raw Input mode to edit the JSON directly.

<!-- gh-comment-id:632275188 --> @AndrewBastin commented on GitHub (May 21, 2020): @someshkar Thank you for opening the issue. We will look into the issue ASAP. For now, I suggest you use the Raw Input mode to edit the JSON directly.
Author
Owner

@someshkar commented on GitHub (May 22, 2020):

@someshkar Thank you for opening the issue.

We will look into the issue ASAP.

For now, I suggest you use the Raw Input mode to edit the JSON directly.

@AndrewBastin How exactly do I access the Raw Input mode for editing the JSON directly?

<!-- gh-comment-id:632453959 --> @someshkar commented on GitHub (May 22, 2020): > @someshkar Thank you for opening the issue. > > We will look into the issue ASAP. > > For now, I suggest you use the Raw Input mode to edit the JSON directly. @AndrewBastin How exactly do I access the Raw Input mode for editing the JSON directly?
Author
Owner

@liyasthomas commented on GitHub (May 22, 2020):

@someshkar toggle "Raw Input"
InShot_20200522_084334764

<!-- gh-comment-id:632455800 --> @liyasthomas commented on GitHub (May 22, 2020): @someshkar toggle "Raw Input" ![InShot_20200522_084334764](https://user-images.githubusercontent.com/10395817/82627758-b941f380-9c08-11ea-9d97-775c2d3350f5.jpg)
Author
Owner

@someshkar commented on GitHub (May 22, 2020):

@liyasthomas Alright thanks!

<!-- gh-comment-id:632456629 --> @someshkar commented on GitHub (May 22, 2020): @liyasthomas Alright thanks!
Author
Owner

@liyasthomas commented on GitHub (May 22, 2020):

key - value pairs should only be used for string types. For arrays, switch to "Raw input".

<!-- gh-comment-id:632943729 --> @liyasthomas commented on GitHub (May 22, 2020): key - value pairs should only be used for string types. For arrays, switch to "Raw input".
Author
Owner

@AndrewBastin commented on GitHub (May 22, 2020):

@liyasthomas won't it be nice if there is warning or toast or something about this ?

<!-- gh-comment-id:632944997 --> @AndrewBastin commented on GitHub (May 22, 2020): @liyasthomas won't it be nice if there is warning or toast or something about this ?
Author
Owner

@liyasthomas commented on GitHub (May 22, 2020):

Okay, a toast should be appropriate.

<!-- gh-comment-id:632945582 --> @liyasthomas commented on GitHub (May 22, 2020): Okay, a toast should be appropriate.
Author
Owner

@someshkar commented on GitHub (May 23, 2020):

Yeah, a toast makes sense for now.

<!-- gh-comment-id:633024789 --> @someshkar commented on GitHub (May 23, 2020): Yeah, a toast makes sense for now.
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#312
No description provided.