mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #1435] Provide a visual editor for JSON/KV request bodies #463
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#463
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kotx on GitHub (Jan 22, 2021).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/1435
Originally assigned to: @Reflex-Gravity on GitHub.
Is your feature request related to a problem? Please describe.
Users cannot send JSON to an endpoint if the endpoint requires numbers to be JSON numbers. Currently Hoppscotch serializes all parameters as JSON strings.
Describe the solution you'd like

User input:
Expected behaviour: user can either select the parameter type and/or the value gets automatically converted into the proper type.
Describe alternatives you've considered
Can always use the raw request bodies, but that is less convenient.
@liyasthomas commented on GitHub (Jan 22, 2021):
This is not a convenient way.
On the other hand, raw request body is especially made to address this issue. Let me know why raw request body is less convenient for you.
@kotx commented on GitHub (Jan 22, 2021):
The process would be faster if the parameters were synchronized between raw and normal request bodies. Currently I have to rewrite the JSON entirely, unless that's a bug.
Also, autodetection seems much more convenient than editing a raw request body. There aren't many edge cases where the server only accepts a number (or some other type) as a string AFAIK.
@Reflex-Gravity commented on GitHub (Mar 22, 2021):
Can I take this issue?
If Yes, Please brief me about the implementation.
@liyasthomas commented on GitHub (Mar 23, 2021):
@Reflex-Gravity so, when you choose request method as
POST,PUT, orDELETEyou can add request body from request section. And it can be done in two ways. Key-value pairs and Raw input.This feature enable syncing both of them. Whenever you add a key-value pair - it should reflect in Raw input and when you add a Raw input (JSON object) it should reflect in key-value pair.
POSTrequest methodhttps://httpbin.org/postKey-value pair
Raw input
@Reflex-Gravity commented on GitHub (Mar 24, 2021):
In the key:value view, what if its a nested JSON, should I set the 2nd level JSON as a value to the key?
@liyasthomas commented on GitHub (Mar 24, 2021):
That won't be a desired behaviour. If there's a 2nd level array, there's chance and probability of 3rd and 4th
level arrays. I guess we can only sync key-value pairs with simple JSON object and vice versa. If the raw JSON has nested arrays - I would not recommend using it in key value pairs.
Would like to know what @kotx think about this. Anyways @Reflex-Gravity you can just omit nested JSON for now.
@kotx commented on GitHub (Mar 24, 2021):
This sounds good! It would be ideal for the JSON to be preserved when converted to key-value pairs, but seeing as they are just key-value pairs I think it is fine. There should probably be a warning before conversion though.
@liyasthomas commented on GitHub (Mar 25, 2021):
@kotx does this deploy preview fits your use case: https://deploy-preview-1562--hoppscotch.netlify.app/
@kotx commented on GitHub (Mar 25, 2021):
Yes, that is excellent.