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
Context: Currently, inja requires string literals are specified in double quotation marks, because it follows the JSON data syntax. But templates in jinja2 can specify string literals using either single or double quotation marks.
Current behavior: It appears inja silently ignores single quotation marks, so these objects are interpreted as variables rather than string literals. For example, {{ "a" == "a" }} returns true, but {{ 'a' == 'a' }} raises error "variable 'a' not found". These error messages can confuse end users. For example, {{ join(cols, ', ') }} raises error "unknown function join".
Resolution: There are various approaches to improve this edge case. I've listed my ideas in order of preference:
Accept string literals in single quotation marks (e.g., replace with double quotation marks before sending to JSON parser).
Ability to configure Environment to accept string literals in single quotation marks.
Recognize string literals in single quotation marks and provide informative error message.
The text was updated successfully, but these errors were encountered:
Context: Currently, inja requires string literals are specified in double quotation marks, because it follows the JSON data syntax. But templates in jinja2 can specify string literals using either single or double quotation marks.
Current behavior: It appears inja silently ignores single quotation marks, so these objects are interpreted as variables rather than string literals. For example,
{{ "a" == "a" }}
returns true, but{{ 'a' == 'a' }}
raises error "variable 'a' not found". These error messages can confuse end users. For example,{{ join(cols, ', ') }}
raises error "unknown function join".Resolution: There are various approaches to improve this edge case. I've listed my ideas in order of preference:
Environment
to accept string literals in single quotation marks.The text was updated successfully, but these errors were encountered: