Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle JSON Parameter list validation #891

Closed
someshkar opened this issue May 21, 2020 · 8 comments
Closed

Handle JSON Parameter list validation #891

someshkar opened this issue May 21, 2020 · 8 comments
Assignees
Labels
feature New feature or request

Comments

@someshkar
Copy link

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

@AndrewBastin
Copy link
Member

@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.

@someshkar
Copy link
Author

@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?

@liyasthomas
Copy link
Member

@someshkar toggle "Raw Input"
InShot_20200522_084334764

@someshkar
Copy link
Author

@liyasthomas Alright thanks!

@liyasthomas
Copy link
Member

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

@AndrewBastin
Copy link
Member

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

@liyasthomas
Copy link
Member

Okay, a toast should be appropriate.

@liyasthomas liyasthomas self-assigned this May 22, 2020
@AndrewBastin AndrewBastin reopened this May 22, 2020
@AndrewBastin AndrewBastin changed the title JSON body doesn't accept arrays Handle JSON Parameter list validation May 22, 2020
@someshkar
Copy link
Author

Yeah, a toast makes sense for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants