Kong / insomnia

The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.

Home Page:https://insomnia.rest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Response preview adds whitespace to URL

Tolsto opened this issue · comments

commented

Expected Behavior

The preview should not add a whitespace in the middle of the URL.

Actual Behavior

image image

Reproduction Steps

No response

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

9.0.0-beta.3

What operating system are you using?

macOS

Operating System Version

14.4.1 (23E224)

Installation method

dmg

Last Known Working Insomnia version

No response

Able to reproduce this bug. Specifically, seems to happen when both of the following conditions are met:

  • Response contains a JSON key value enclosed in single quotes rather than double quotes
  • Value that is enclosed in the aforementioned single quotes contains a colon

Not sure why this happens.

Worth noting, single quotes for JSON keys and values is technically invalid syntax (although some popular JSON formatters are lenient on this). This is still a valid bug though of course.

commented

Hm, didn't even notice the single quotes. That's actually the default serialization of AWS Lambda, at least when running locally with SAM CLI.

Appears to be caused by this line. In the prettify function taken from json-lint.

  1. pull a newer copy of this code from json-lint
  2. add a test and fix it inline
  3. use prettier or some other formatter than can accept single quoted objects

That's actually the default serialization of AWS Lambda

Single quotes is not a valid JSON value, this is a problem with AWS.