Replies: 2 comments 1 reply
-
Thank you for reaching out! 👋We appreciate you taking the time to ask your question or report an issue. Please note that response times may vary as we work through requests. We'll get back to you as soon as possible. If you require priority support or enterprise assistance, you can explore our support options on mockoon.com. Alternatively, for a guaranteed fast response (usually within a day), you can purchase a one-time support request via GitHub Sponsors. Thank you for your patience and for being part of the Mockoon community! |
Beta Was this translation helpful? Give feedback.
-
Hi, and thank you! This is due to the fact that curly braces in curly braces (
Please note that the brackets do not represent a function call (you cannot do |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, and thank you for your great work on Mockoon!! I've been using it for a few months and I really appreciate how simple and intuitive it is.
While working with local variables and Faker helpers, I tried assigning the output of a Faker helper directly to a local variable using setVar, even though this use case isn't explicitly documented.
What I attempted
I tried the following:
{{setVar 'name' '{{faker person.firstName}}'}}
I also tried various alternatives: using different types of quotes (single, double, none), escaping the quotes, etc.. unfortunately, none of these approaches worked.
My intention was to store the generated value in a local variable so I could reuse it later in the response body.
Result
This results in a templating error. It seems that the inner helper expression is not being resolved before being passed to setVar.
I understand this might not be a currently supported use case, as I didn’t find any mention of this pattern in the documentation. Would it be possible to support this in a future release? Or is there currently an alternative way to assign dynamic values (e.g., FakerJS-generated data) to local variables for reuse?
Beta Was this translation helpful? Give feedback.
All reactions