Skip to content

Commit 0cade09

Browse files
committed
added comments, fixed indentation
1 parent 93579fe commit 0cade09

File tree

1 file changed

+11
-1
lines changed
  • modules/openapi-generator/src/main/resources/Java/libraries/native

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,17 @@ import java.util.concurrent.CompletableFuture;
5656
{{>generatedAnnotation}}
5757
{{#operations}}
5858
public class {{classname}} {
59+
/**
60+
* Utility class for extending HttpRequest.Builder functionality.
61+
*/
5962
private static class HttpRequestBuilderExtensions {
63+
/**
64+
* Adds additional headers to the provided HttpRequest.Builder. Useful for adding method/endpoint specific headers.
65+
*
66+
* @param builder the HttpRequest.Builder to which headers will be added
67+
* @param headers a map of header names and values to add; may be null
68+
* @return the same HttpRequest.Builder instance with the additional headers set
69+
*/
6070
static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map<String, String> headers) {
6171
if (headers != null) {
6272
for (Map.Entry<String, String> entry : headers.entrySet()) {
@@ -282,7 +292,7 @@ public class {{classname}} {
282292
{{/isDeprecated}}
283293
public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture<Void>{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#allParams}}{{>nullable_var_annotations}} {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}Map<String, String> headers) throws ApiException {
284294
{{^asyncNative}}
285-
{{#returnType}}ApiResponse<{{{.}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers);
295+
{{#returnType}}ApiResponse<{{{.}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}headers);
286296
{{#returnType}}
287297
return localVarResponse.getData();
288298
{{/returnType}}

0 commit comments

Comments
 (0)