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

Global variable can be set as number but can't be modified/deleted #3859

Open
2 tasks done
igorskrasjukovsif opened this issue Jan 22, 2025 · 1 comment
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@igorskrasjukovsif
Copy link

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

When global variable is set from Post Response scripts where value is a number, value is set to Global variables but can't be updated by the same script.
Value also can't be deleted: ValidationError: variables[0].value must be a stringtype, but the final value was:1.

.bru file to reproduce the bug

meta {
name: int issue
type: http
seq: 2
}

get {
url: https://api.sampleapis.com/countries/countries
body: none
auth: none
}

script:post-response {
const response = res.getBody();
bru.setGlobalEnvVar('id', response[0].id);
}

Screenshots/Live demo link

Image

ValidationError: variables[0].value must be a `string` type, but the final value was: `1`.
    at Object.y [as createError] (807.18085531.js:140:622700)
    at Object.test (807.18085531.js:143:2994)
    at t (807.18085531.js:140:622891)
    at R (807.18085531.js:140:620743)
    at ea._validate (807.18085531.js:143:601)
    at ea.validate (807.18085531.js:143:840)
    at 807.18085531.js:143:14572
    at R (807.18085531.js:140:620743)
    at 807.18085531.js:143:14411
    at 807.18085531.js:140:620538
@igorskrasjukovsif igorskrasjukovsif added the bug Something isn't working label Jan 22, 2025
@igorskrasjukovsif igorskrasjukovsif changed the title Global variable can be set as number but nat't be modufied/used/deleted Global variable can be set as number but can't be modified/deleted Jan 22, 2025
@ganesh-bruno ganesh-bruno self-assigned this Jan 23, 2025
@ganesh-bruno
Copy link
Collaborator

Hey @igorskrasjukovsif,

Thanks for reporting this issue!

I’ve been able to reproduce it, and we're working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants