inconsistent behaviour with withFailOnUnknownTokens
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Reproduce the example using JinjavaConfig.withFailOnUnknownTokens, Jinjava.render, and an empty Context, then inspect how the undefined foo expression is handled. Compare the result with the FatalTemplateErrorsException path; done means the configured behavior is consistent for this undefined token case.
Written by the indexing model from the issue text.
Description
JinjavaConfig config = JinjavaConfig.newBuilder().withFailOnUnknownTokens(true).build();
Jinjava jinjava = new Jinjava(config);
String[] templates = new String[]{
"{% if foo == 'bar' %}baz{% endif %}"
};
for (String template : templates) {
System.out.println("Template: " + template);
try {
jinjava.render(template, new Context());
System.out.println("Works!\n");
}
catch (FatalTemplateErrorsException e) {
System.out.println("Doesn't work: " + e.getMessage() + "\n");
}
}
It doesn't throw exception as foo is not defined in the context.
- Dominant language
- Java
- Stars
- 785
- Forks
- 184
- Avg merge
- 6d 22h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HubSpot/jinjava
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
Jinjava 3.0 Open
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
elastic/gradle-plugins#157 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cryptomator/hub#497 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
johanhaleby/occurrent#1120 ·