File tree 2 files changed +24
-0
lines changed
src/main/java/io/swagger/codegen
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ package io .swagger .codegen .handlebars .helpers ;
2
+
3
+ import com .github .jknack .handlebars .Helper ;
4
+ import com .github .jknack .handlebars .Options ;
5
+
6
+ public class BracesHelper implements Helper <String > {
7
+
8
+ public static final String NAME = "braces" ;
9
+ private static final String RIGHTT_ORIENTATION = "right" ;
10
+ private static final String LEFT_CURLY_BRACES = "{{" ;
11
+ private static final String RIGHT_CURLY_BRACES = "}}" ;
12
+
13
+ @ Override
14
+ public Object apply (String orientation , Options options ) {
15
+ if (RIGHTT_ORIENTATION .equalsIgnoreCase (orientation )) {
16
+ return RIGHT_CURLY_BRACES ;
17
+ }
18
+ return LEFT_CURLY_BRACES ;
19
+ }
20
+
21
+
22
+ }
Original file line number Diff line number Diff line change 15
15
import io .swagger .codegen .CodegenResponse ;
16
16
import io .swagger .codegen .CodegenSecurity ;
17
17
import io .swagger .codegen .SupportingFile ;
18
+ import io .swagger .codegen .handlebars .helpers .BracesHelper ;
18
19
import io .swagger .codegen .handlebars .helpers .HasHelper ;
19
20
import io .swagger .codegen .handlebars .helpers .HasNotHelper ;
20
21
import io .swagger .codegen .handlebars .helpers .IsHelper ;
@@ -3257,6 +3258,7 @@ public void addHandlebarHelpers(Handlebars handlebars) {
3257
3258
handlebars .registerHelper (HasHelper .NAME , new HasHelper ());
3258
3259
handlebars .registerHelper (IsNotHelper .NAME , new IsNotHelper ());
3259
3260
handlebars .registerHelper (HasNotHelper .NAME , new HasNotHelper ());
3261
+ handlebars .registerHelper (BracesHelper .NAME , new BracesHelper ());
3260
3262
}
3261
3263
3262
3264
@ Override
You can’t perform that action at this time.
0 commit comments