-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[BUG] [>1.6.1] Array variables created with pre-request scripts are not treated as variables in Body. #1635
Labels
Comments
You can, you use a workaround like this, in the pre-request script. This will send the array correctly. const body = req.getBody();
body.test = ["Hello", "World"];
req.setBody(body); |
Thanks that seemed to work ! |
Any updates on this bug? |
Its-treason
added a commit
to Its-treason/bruno
that referenced
this issue
Mar 24, 2024
Interpolate will now fallback to the original object to collect variable values. Objets will automaticly json encoded. And if intererpolate is executed for the json body all variables will be json encoded so strings get double quoted. This should fix: - usebruno#1910 - usebruno#1635
Its-treason
added a commit
to Its-treason/bruno
that referenced
this issue
Mar 25, 2024
Interpolate will now fallback to the original object to collect variable values. Objets will automaticly json encoded. And if intererpolate is executed for the json body all variables will be json encoded so strings get double quoted. This should fix: - usebruno#1910 - usebruno#1635
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I recently noticed an issue that happens with version 1.7.0 and onwards.
The issue is similar to #1217, but also affects the JSON request body and as far as I noticed only with variables created by a pre-request script.
The issue doesn't appear with version 1.6.1 and lower.
In the pre-request script, we create an array to be used in the request body.
Request body :
In the response, we see the that the variable was treated as a plain value.
This only seems to impact Arrays.
If I replace my pre-request script with a simple string...
It works fine :
The text was updated successfully, but these errors were encountered: