Skip to content

Commit 24aa32e

Browse files
committed
updated templates to fix compile errors on java generators
1 parent d195575 commit 24aa32e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/main/resources/handlebars/Java/libraries/feign/ApiClient.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class ApiClient {
5353
this();
5454
for(String authName : authNames) {
5555
{{#hasAuthMethods}}
56-
RequestInterceptor auth;
56+
RequestInterceptor auth = null;
5757
{{#authMethods}}if ("{{name}}".equals(authName)) {
5858
{{#is this 'basic'}}
5959
auth = new HttpBasicAuth();

src/main/resources/handlebars/Java/libraries/retrofit/ApiClient.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class ApiClient {
5454
this();
5555
for(String authName : authNames) {
5656
{{#hasAuthMethods}}
57-
Interceptor auth;
57+
Interceptor auth = null;
5858
{{#authMethods}}if ("{{name}}".equals(authName)) {
5959
{{#is this 'basic'}}
6060
auth = new HttpBasicAuth();

src/main/resources/handlebars/Java/libraries/retrofit2/ApiClient.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class ApiClient {
6161
this();
6262
for(String authName : authNames) {
6363
{{#hasAuthMethods}}
64-
Interceptor auth;
64+
Interceptor auth = null;
6565
{{#authMethods}}if ("{{name}}".equals(authName)) {
6666
{{#is this 'basic'}}
6767
auth = new HttpBasicAuth();

src/main/resources/handlebars/Java/modelEnum.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum
5252
}
5353
{{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{{classname}}}' enum.");{{/errorOnUnknownEnum}}
5454
}
55-
{{#if gson}}
55+
{{#gson}}
5656

5757
public static class Adapter extends TypeAdapter<{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> {
5858
@Override
@@ -63,8 +63,8 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum
6363
@Override
6464
public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException {
6565
Object value = {{#isNumber}}new BigDecimal(jsonReader.nextDouble()){{/isNumber}}{{^isNumber}}jsonReader.{{#isInteger}}nextInt(){{/isInteger}}{{^isInteger}}nextString(){{/isInteger}}{{/isNumber}};
66-
return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue(({{{datatype}}})(value));
66+
return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue(({{{dataType}}})(value));
6767
}
6868
}
69-
{{/if}}
69+
{{/gson}}
7070
}

0 commit comments

Comments
 (0)