Skip to content

Commit

Permalink
Add option for LegacyOverrides.ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmith-hs committed Oct 30, 2023
1 parent 35b2551 commit 3874722
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/com/hubspot/jinjava/LegacyOverrides.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@
/**
* This class allows Jinjava to be configured to override legacy behaviour.
* LegacyOverrides.NONE signifies that none of the legacy functionality will be overridden.
* LegacyOverrides.ALL signifies that all new functionality will be used; avoid legacy "bugs".
*/
public class LegacyOverrides {
public static final LegacyOverrides NONE = new LegacyOverrides.Builder().build();
public static final LegacyOverrides ALL = new LegacyOverrides.Builder()
.withEvaluateMapKeys(true)
.withIterateOverMapKeys(true)
.withUsePyishObjectMapper(true)
.withUseSnakeCasePropertyNaming(true)
.withWhitespaceRequiredWithinTokens(true)
.withUseNaturalOperatorPrecedence(true)
.withParseWhitespaceControlStrictly(true)
.withAllowAdjacentTextNodes(true)
.build();
private final boolean evaluateMapKeys;
private final boolean iterateOverMapKeys;
private final boolean usePyishObjectMapper;
Expand Down

0 comments on commit 3874722

Please sign in to comment.