Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't sent json body that contain Mustache variables #7356

Closed
1 task done
JdKock opened this issue May 2, 2024 · 1 comment
Closed
1 task done

Can't sent json body that contain Mustache variables #7356

JdKock opened this issue May 2, 2024 · 1 comment
Labels
M-as-intended Marked: As Intended

Comments

@JdKock
Copy link

JdKock commented May 2, 2024

Expected Behavior

For the Elasticsearch API I need to send some json body with Mustache variables. Here a simple example:

{
	"script": {
		"lang": "mustache",
		"source": {
			"size": "{{var-limit}}",
			"query": {
				"match_all": {}
			}
		}
	}
}

This should be sent to the API as is. Elasticsearch replaces the variable "var-limit" with the value from params.
In Postman this is no problem what is send is: "size": "{{var-limit}}"

Actual Behavior

In Insomnia the mustache variable is trying to be replaced with a value before the request is send to Elasticsearch. There is no variable var-limit so what is now send is: "size": "NaN".

Reproduction Steps

No response

Is there an existing issue for this?

Additional Information

No response

Insomnia Version

9.0.0

What operating system are you using?

macOS

Operating System Version

macOS 14.4.1

Installation method

homebrew

Last Known Working Insomnia version

No response

@JdKock JdKock added B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels May 2, 2024
@jackkav
Copy link
Contributor

jackkav commented May 22, 2024

I suggest using nunjucks syntax keys raw and endraw to stop it from tokenising your input using something like this.
{% raw %}your double braced value goes here {{ dontchangeme }}{% endraw %}

@jackkav jackkav added M-as-intended Marked: As Intended and removed B-bug Bug: general classification S-unverified Status: Unverified by maintainer labels May 22, 2024
@jackkav jackkav closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-as-intended Marked: As Intended
Projects
None yet
Development

No branches or pull requests

2 participants