mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[GH-ISSUE #5698] [bug]: Json body serialize in CLI content-type #2217
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#2217
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 @billmartensson on GitHub (Dec 16, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/5698
Originally assigned to: @jamesgeorge007 on GitHub.
Is there an existing issue for this?
Platform
Desktop App
Browser
Chrome
Operating System
macOS
Bug Description
We use AWS Cognito for user authentication.
In desktop we have request to do sign in and in post-request script capture session token to be used in other requests to our API. Works as it should.
Now setting up CLI, export collection and get error.
AWS use header:
Content-Type: application/x-amz-json-1.1
This is required (and kinda odd...)
Hoppscotch CLI does not recognize the header and wont serialize correctly. Leading to bad data being sent.
Works in desktop so should work the same.
Deployment Type
Hoppscotch Cloud
Version
No response
@billmartensson commented on GitHub (Dec 19, 2025):
Step to reproduce:
POST https://cognito-idp.eu-north-1.amazonaws.com
Headers:
Content-Type: application/x-amz-json-1.1
X-Amz-Target: AWSCognitoIdentityProviderService.InitiateAuth
Body:
{
"AuthParameters" : {
"USERNAME" : "a",
"PASSWORD" : "b"
},
"AuthFlow" : "USER_PASSWORD_AUTH",
"ClientId" : "123"
}
Desktop response:
status 400
message: "User pool client 123 does not exist" (as expected)
CLI response:
status 400
body: { __type: 'SerializationException' }
@jamesgeorge007 commented on GitHub (Jan 1, 2026):
Hi, the response was consistent in the CLI as observed. Please confirm whether you are using the latest version of the CLI.
@billmartensson commented on GitHub (Jan 5, 2026):
npm list -g shows:
@hoppscotch/cli@0.30.0
hopp -v shows: 0.30.0
Confirmed same result.
Desktop response from api is expected error because dummy data.
CLI response is SerializationException.
Run on MacOS 26.
@jamesgeorge007 commented on GitHub (Jan 9, 2026):
I've set up a test collection that matches your reproduction steps exactly. Could you please test with this collection and share the full output?
hopp test col.json.On my end, with
v0.30.0, I'm gettingResourceNotFoundException(the expected response), but I want to confirm if you're seeing different behaviour.@billmartensson commented on GitHub (Jan 9, 2026):
Issue found. Your example worked. Compared to my non working one. Everything same, except my example was pasted body from AWS that included a comment. Which is no issue in desktop but gives error in CLI.
A body like this gives error:
{
"AuthParameters" : {
"USERNAME" : "a",
"PASSWORD" : "b"
},
"AuthFlow" : "USER_PASSWORD_AUTH", // Comment will cause error
"ClientId" : "123"
}
Perhaps not really a error in CLI, more a inconsistency.
Thanks for your help with example.
@jamesgeorge007 commented on GitHub (Jan 13, 2026):
Thanks for elaborating. We've identified the root cause stemming from the inconsistent behaviour with the CLI, where JSON comments as part of the request body aren't stripped before request execution, as opposed to the app. A fix has been raised at #5769, scheduled for the upcoming release.
@jamesgeorge007 commented on GitHub (Jan 28, 2026):
Closing since this is now addressed in CLI
v0.30.1as part of the v2026.1.0 release.