{{'false' ? 'yes' : 'no'}} is interpreted as {{false ? 'yes' : 'no'}}
还没有人认领这个 Issue。
评估
调研方向
首先,使用将 PARAM 设置为字符串 "false" 以及 issue 中显示的条件表达式来复现该示例。跟踪 Jinjava 如何在布尔条件中评估字符串值;完成的标准是确定这是否为预期行为,或确定一项针对性的修改和一个用于保留字符串值的回归测试。
由索引模型根据 Issue 内容生成。
描述
Hello. I found that if a string has a boolean value, then it is interpreted as the boolean value it contains.
For example
PARAM = "false"
JINJA_EXPR = {{ PARAM ? PARAM : "" }}
After rendering JINJA_EXPR, the output is "" but I expect it to be "false" meaning the param is present and can be used.
Could you please explain how to remove this behavior? Or if the latter is not possible could you please tell me how to resolve the case I described?
- 主要语言
- Java
- 星标
- 785
- 派生
- 184
- 平均合并
- 6 天 22 小时
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
HubSpot/jinjava 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
-
Jinjava 3.0 未关闭
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
难度 3/5 1-2 天 新手友好度 45/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
HL7/fhir-ig-publisher#1375 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
-
Flaky: a relaunched catch-up replay can still report catching up right after its marker is written 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
johanhaleby/occurrent#1134 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
objectionary/jeo-maven-plugin#1811 ·
-
难度 2/5 1-3 小时 新手友好度 88/100