[GH-ISSUE #5698] [bug]: Json body serialize in CLI content-type #2217

Closed
opened 2026-03-16 23:36:08 +03:00 by kerem · 7 comments
Owner

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?

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

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

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? - [x] I have searched existing issues and this bug hasn't been reported yet ### 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_
kerem 2026-03-16 23:36:08 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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' }

<!-- gh-comment-id:3674075747 --> @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' }
Author
Owner

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

<!-- gh-comment-id:3703474216 --> @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](https://www.npmjs.com/package/@hoppscotch/cli?activeTab=versions) of the CLI.
Author
Owner

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

<!-- gh-comment-id:3709441284 --> @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.
Author
Owner

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

  1. Download this collection: col.json.
  2. Run: hopp test col.json.
  3. Share the complete output (including any error messages).

On my end, with v0.30.0, I'm getting ResourceNotFoundException (the expected response), but I want to confirm if you're seeing different behaviour.

Image
<!-- gh-comment-id:3727604596 --> @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? 1. Download this collection: [col.json](https://github.com/user-attachments/files/24522232/col.json). 2. Run: `hopp test col.json`. 3. Share the complete output (including any error messages). On my end, with `v0.30.0`, I'm getting `ResourceNotFoundException` (the expected response), but I want to confirm if you're seeing different behaviour. <img width="835" height="390" alt="Image" src="https://github.com/user-attachments/assets/fefca626-8233-4be3-a135-ee8ccef32c1a" />
Author
Owner

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

<!-- gh-comment-id:3727827611 --> @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.
Author
Owner

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

<!-- gh-comment-id:3743777145 --> @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.
Author
Owner

@jamesgeorge007 commented on GitHub (Jan 28, 2026):

Closing since this is now addressed in CLI v0.30.1 as part of the v2026.1.0 release.

<!-- gh-comment-id:3810919219 --> @jamesgeorge007 commented on GitHub (Jan 28, 2026): Closing since this is now addressed in CLI `v0.30.1` as part of the [v2026.1.0](https://github.com/hoppscotch/hoppscotch/releases/tag/2026.1.0) release.
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#2217
No description provided.