Skip to content

Commit 8ca3543

Browse files
authored
Issue 20804: Add java nullability annotations (#20806)
* issue-20804: Add nullability annotations to Java generated clients Motivation: Be able to use generated clients in code checked by tools like NullAway. * issue-20804: Add nullability annotations to Java generated clients Motivation: Be able to use generated clients in code checked by tools like NullAway. * issue-20804: Add nullability annotations to Java generated clients Motivation: Be able to use generated clients in code checked by tools like NullAway.
1 parent d81b5a3 commit 8ca3543

File tree

228 files changed

+4520
-4421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+4520
-4421
lines changed

modules/openapi-generator/src/main/resources/Java/api.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class {{classname}} {
6161
{{#isDeprecated}}
6262
@Deprecated
6363
{{/isDeprecated}}
64-
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
64+
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
6565
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
6666
{{#allParams}}{{#required}}
6767
// verify the required parameter '{{paramName}}' is set

modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/api.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class {{classname}} extends BaseApi {
6262
{{#isDeprecated}}
6363
@Deprecated
6464
{{/isDeprecated}}
65-
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
65+
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
6666
{{#returnType}}return {{/returnType}}this.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}Collections.emptyMap());
6767
}
6868

@@ -89,7 +89,7 @@ public class {{classname}} extends BaseApi {
8989
{{#isDeprecated}}
9090
@Deprecated
9191
{{/isDeprecated}}
92-
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Map<String, String> additionalHeaders) throws ApiException {
92+
public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}, {{/allParams}}Map<String, String> additionalHeaders) throws ApiException {
9393
Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}};
9494
{{#allParams}}{{#required}}
9595
// verify the required parameter '{{paramName}}' is set

modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public interface {{classname}} extends ApiClient.Api {
5252
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}},
5353
{{/-last}}{{/headerParams}}
5454
})
55-
{{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
55+
{{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
5656

5757
/**
5858
* {{summary}}
@@ -82,7 +82,7 @@ public interface {{classname}} extends ApiClient.Api {
8282
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}},
8383
{{/-last}}{{/headerParams}}
8484
})
85-
ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
85+
ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
8686

8787

8888
{{#hasQueryParams}}
@@ -127,7 +127,7 @@ public interface {{classname}} extends ApiClient.Api {
127127
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}},
128128
{{/-last}}{{/headerParams}}
129129
})
130-
{{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams);
130+
{{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams);
131131

132132
/**
133133
* {{summary}}
@@ -167,7 +167,7 @@ public interface {{classname}} extends ApiClient.Api {
167167
"{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}},
168168
{{/-last}}{{/headerParams}}
169169
})
170-
ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams);
170+
ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{nickname}}WithHttpInfo({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^isFormParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isFormParam}}{{#isFormParam}}@Param("{{baseName}}") {{/isFormParam}}{{/isBodyParam}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) {{operationIdCamelCase}}QueryParams queryParams);
171171

172172

173173
/**
@@ -176,7 +176,7 @@ public interface {{classname}} extends ApiClient.Api {
176176
*/
177177
public static class {{operationIdCamelCase}}QueryParams extends HashMap<String, Object> {
178178
{{#queryParams}}
179-
public {{operationIdCamelCase}}QueryParams {{paramName}}(final {{{dataType}}} value) {
179+
public {{operationIdCamelCase}}QueryParams {{paramName}}({{>nullable_var_annotations}} final {{{dataType}}} value) {
180180
{{#collectionFormat}}
181181
put("{{baseName}}", EncodingUtils.encodeCollection(value, "{{collectionFormat}}"));
182182
{{/collectionFormat}}

modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public class {{classname}} {
6161
{{#isDeprecated}}
6262
@Deprecated
6363
{{/isDeprecated}}
64-
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException {
64+
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException {
6565
{{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}}
6666
TypeReference<{{{returnType}}}> typeRef = new TypeReference<{{{returnType}}}>() {};
6767
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}}
@@ -85,7 +85,7 @@ public class {{classname}} {
8585
{{#isDeprecated}}
8686
@Deprecated
8787
{{/isDeprecated}}
88-
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
88+
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
8989
{{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}params);{{#returnType}}
9090
TypeReference<{{{returnType}}}> typeRef = new TypeReference<{{{returnType}}}>() {};
9191
return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}}
@@ -94,7 +94,7 @@ public class {{classname}} {
9494
{{#isDeprecated}}
9595
@Deprecated
9696
{{/isDeprecated}}
97-
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException {
97+
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException {
9898
{{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
9999
if ({{paramName}} == null) {
100100
throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}");
@@ -128,7 +128,7 @@ public class {{classname}} {
128128
{{#isDeprecated}}
129129
@Deprecated
130130
{{/isDeprecated}}
131-
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{#isBodyParam}}java.io.InputStream {{paramName}}{{/isBodyParam}}{{^isBodyParam}}{{{dataType}}} {{paramName}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}, String mediaType) throws IOException {
131+
public HttpResponse {{operationId}}ForHttpResponse({{#allParams}}{{#isBodyParam}}java.io.InputStream {{paramName}}{{/isBodyParam}}{{^isBodyParam}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{/isBodyParam}}{{^-last}}, {{/-last}}{{/allParams}}, String mediaType) throws IOException {
132132
{{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
133133
if ({{paramName}} == null) {
134134
throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}");
@@ -164,7 +164,7 @@ public class {{classname}} {
164164
{{#isDeprecated}}
165165
@Deprecated
166166
{{/isDeprecated}}
167-
public HttpResponse {{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
167+
public HttpResponse {{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map<String, Object> params) throws IOException {
168168
{{#allParams}}{{#required}}// verify the required parameter '{{paramName}}' is set
169169
if ({{paramName}} == null) {
170170
throw new IllegalArgumentException("Missing the required parameter '{{paramName}}' when calling {{operationId}}");

modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class {{classname}} {
8686
{{#isDeprecated}}
8787
@Deprecated
8888
{{/isDeprecated}}
89-
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
89+
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
9090
{{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}.getData(){{/returnType}};
9191
}
9292
{{/vendorExtensions.x-group-parameters}}
@@ -121,7 +121,7 @@ public class {{classname}} {
121121
{{#isDeprecated}}
122122
@Deprecated
123123
{{/isDeprecated}}
124-
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
124+
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
125125
{{#hasRequiredParams}}
126126
// Check required parameters
127127
{{#allParams}}
@@ -205,10 +205,11 @@ public class {{classname}} {
205205

206206
public class API{{operationId}}Request {
207207
{{#allParams}}
208+
{{>nullable_var_annotations}}
208209
private {{{dataType}}} {{paramName}};
209210
{{/allParams}}
210211

211-
private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) {
212+
private API{{operationId}}Request({{#pathParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) {
212213
{{#pathParams}}
213214
this.{{paramName}} = {{paramName}};
214215
{{/pathParams}}
@@ -221,7 +222,7 @@ public class {{classname}} {
221222
* @param {{paramName}} {{description}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}})
222223
* @return API{{operationId}}Request
223224
*/
224-
public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) {
225+
public API{{operationId}}Request {{paramName}}({{>nullable_var_annotations}} {{{dataType}}} {{paramName}}) {
225226
this.{{paramName}} = {{paramName}};
226227
return this;
227228
}
@@ -287,7 +288,7 @@ public class {{classname}} {
287288
{{#isDeprecated}}
288289
@Deprecated
289290
{{/isDeprecated}}
290-
public API{{operationId}}Request {{operationId}}({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) throws ApiException {
291+
public API{{operationId}}Request {{operationId}}({{#pathParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) throws ApiException {
291292
return new API{{operationId}}Request({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}});
292293
}
293294
{{/vendorExtensions.x-group-parameters}}

modules/openapi-generator/src/main/resources/Java/libraries/jersey3/api.mustache

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class {{classname}} {
8686
{{#isDeprecated}}
8787
@Deprecated
8888
{{/isDeprecated}}
89-
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
89+
public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
9090
{{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}.getData(){{/returnType}};
9191
}
9292
{{/vendorExtensions.x-group-parameters}}
@@ -121,7 +121,7 @@ public class {{classname}} {
121121
{{#isDeprecated}}
122122
@Deprecated
123123
{{/isDeprecated}}
124-
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
124+
public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException {
125125
{{#hasRequiredParams}}
126126
// Check required parameters
127127
{{#allParams}}
@@ -205,10 +205,11 @@ public class {{classname}} {
205205

206206
public class API{{operationId}}Request {
207207
{{#allParams}}
208+
{{>nullable_var_annotations}}
208209
private {{{dataType}}} {{paramName}};
209210
{{/allParams}}
210211

211-
private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) {
212+
private API{{operationId}}Request({{#pathParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) {
212213
{{#pathParams}}
213214
this.{{paramName}} = {{paramName}};
214215
{{/pathParams}}
@@ -221,7 +222,7 @@ public class {{classname}} {
221222
* @param {{paramName}} {{description}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}})
222223
* @return API{{operationId}}Request
223224
*/
224-
public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) {
225+
public API{{operationId}}Request {{paramName}}({{>nullable_var_annotations}} {{{dataType}}} {{paramName}}) {
225226
this.{{paramName}} = {{paramName}};
226227
return this;
227228
}
@@ -287,7 +288,7 @@ public class {{classname}} {
287288
{{#isDeprecated}}
288289
@Deprecated
289290
{{/isDeprecated}}
290-
public API{{operationId}}Request {{operationId}}({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) throws ApiException {
291+
public API{{operationId}}Request {{operationId}}({{#pathParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) throws ApiException {
291292
return new API{{operationId}}Request({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}});
292293
}
293294
{{/vendorExtensions.x-group-parameters}}

0 commit comments

Comments
 (0)