insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

bug: `generate request collection` does not generate the environment variables used in the requests

Open cachho opened this issue 2 years ago • 2 comments

Expected Behavior

using the generate request collection button with a spec consisting of

servers:
  - url: http://localhost:9098/working-time

generates the environment

{
	"scheme": "http",
	"base_path": "/working-time",
	"host": "localhost:9098",
	"bearerToken": "bearerToken"
}

which is fine. You should be able to use this environment with your generated requests.

Actual Behavior

However the requests look like this {{ _.base_url }}/login.

base_url is not defined.

So every time you generate a request collection you have to take care of your environement variables.

Reproduction Steps

No response

Is there an existing issue for this?

Additional Information

I guess it either needs to be {{ _.scheme}}:{{ _.host}}{{ _.base_path}}/login or you need to generate a composite variable if that's too verbose.

Insomnia Version

2023.5.8

What operating system are you using?

Windows

Operating System Version

Windows 10

Installation method

download

Last Known Working Insomnia version

No response

cachho avatar Oct 09 '23 09:10 cachho

Same on MacOS:

Version: Insomnia 8.5.0 Build date: 12/20/2023 OS: Darwin arm64 23.2.0 Electron: 27.0.3 Node: 18.17.1 Node ABI: 118 V8: 11.8.172.16-electron.0 Architecture: arm64

Thomasmnielsen avatar Dec 21 '23 09:12 Thomasmnielsen

Came across the same problem. Any update on it?

Jarzebowsky avatar Feb 13 '24 02:02 Jarzebowsky