Skip to content

Commit c60de82

Browse files
committed
populate the map via the default constructor
1 parent 3e5e40d commit c60de82

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,6 @@ protected void useCodegenAsMustacheParentContext() {
391391

392392
@Override
393393
public void processOpts() {
394-
// add open brace {{openbrace}} and close brace {{closebrace}} to additionalProperties for all mustache templates
395-
// to use when needed to use them where mustache would prevent plaintext
396-
additionalProperties.put("openbrace", "{");
397-
additionalProperties.put("closebrace", "}");
398394

399395
if (!additionalProperties.containsKey(CodegenConstants.MUSTACHE_PARENT_CONTEXT)) {
400396
// by default empty parent context
@@ -1865,6 +1861,10 @@ public DefaultCodegen() {
18651861

18661862
// Register common Mustache lambdas.
18671863
registerMustacheLambdas();
1864+
1865+
// Initialize mustache braces placeholders for all generators
1866+
additionalProperties.putIfAbsent("openbrace", "{");
1867+
additionalProperties.putIfAbsent("closebrace", "}");
18681868
}
18691869

18701870
/**

0 commit comments

Comments
 (0)