You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several cases I have encountered that the replaced text from a variable replacer ended up being falsy (e.g. empty string). Because the output of the variable replacer is falsy, httpyac uses the original template string verbatim, instead of replacing it with an empty string.
Common scenarios where I have encountered this is when prompting for user input for e.g. a query parameter that legally accepts empty strings.
I do however realize that there might be other issues with simply replacing falsy values. Maybe we could add a new syntax for falsy-forgiving replacement? E.g. {{? falsyExpression }}. And maybe just modifying the javascript expression replacer is already good enough.
The text was updated successfully, but these errors were encountered:
That an empty string was not allowed here is an error. I think it should work correctly without new syntax. Only the substitution of boolean would currently not be converted correctly as string, but rather only because I would not know which value to use (true vs 1 vs yes).
There are several cases I have encountered that the replaced text from a variable replacer ended up being falsy (e.g. empty string). Because the output of the variable replacer is falsy, httpyac uses the original template string verbatim, instead of replacing it with an empty string.
Common scenarios where I have encountered this is when prompting for user input for e.g. a query parameter that legally accepts empty strings.
I do however realize that there might be other issues with simply replacing falsy values. Maybe we could add a new syntax for falsy-forgiving replacement? E.g.
{{? falsyExpression }}
. And maybe just modifying the javascript expression replacer is already good enough.The text was updated successfully, but these errors were encountered: