diff --git a/docs/generators/java-microprofile.md b/docs/generators/java-microprofile.md index b928fb0f32e3..9e02b37145ef 100644 --- a/docs/generators/java-microprofile.md +++ b/docs/generators/java-microprofile.md @@ -105,6 +105,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false| |useSealedOneOfInterfaces|Generate the oneOf interfaces as sealed interfaces. Only supported for WebClient and RestClient.| |false| |useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY native, jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static with single parameter instantiation.| |false| +|useUnaryInterceptor|If true it will generate ResponseInterceptors using a UnaryOperator. This can be usefull for manipulating the request before it gets passed, for example doing your own decryption| |false| |webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false| |withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index 7c9ffca4760d..b98c5386e4e5 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -105,6 +105,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false| |useSealedOneOfInterfaces|Generate the oneOf interfaces as sealed interfaces. Only supported for WebClient and RestClient.| |false| |useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY native, jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static with single parameter instantiation.| |false| +|useUnaryInterceptor|If true it will generate ResponseInterceptors using a UnaryOperator. This can be usefull for manipulating the request before it gets passed, for example doing your own decryption| |false| |webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false| |withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 43767dc58d00..c532d93fa99b 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -105,6 +105,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String FAIL_ON_UNKNOWN_PROPERTIES = "failOnUnknownProperties"; public static final String SUPPORT_VERTX_FUTURE = "supportVertxFuture"; public static final String USE_SEALED_ONE_OF_INTERFACES = "useSealedOneOfInterfaces"; + public static final String USE_UNARY_INTERCEPTOR = "useUnaryInterceptor"; // Internal configurations public static final String SINGLE_REQUEST_PARAMETER = "singleRequestParameter"; @@ -149,6 +150,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen @Getter @Setter protected boolean failOnUnknownProperties = false; @Setter protected boolean supportVertxFuture = false; @Setter protected boolean useSealedOneOfInterfaces = false; + @Setter protected boolean useUnaryInterceptor = false; protected String authFolder; /** * Serialization library. @@ -260,6 +262,7 @@ public JavaClientCodegen() { cliOptions.add(CliOption.newBoolean(FAIL_ON_UNKNOWN_PROPERTIES, "Fail Jackson de-serialization on unknown properties", this.failOnUnknownProperties)); cliOptions.add(CliOption.newBoolean(SUPPORT_VERTX_FUTURE, "Also generate api methods that return a vertx Future instead of taking a callback. Only `vertx` supports this option. Requires vertx 4 or greater.", this.supportVertxFuture)); cliOptions.add(CliOption.newBoolean(USE_SEALED_ONE_OF_INTERFACES, "Generate the oneOf interfaces as sealed interfaces. Only supported for WebClient and RestClient.", this.useSealedOneOfInterfaces)); + cliOptions.add(CliOption.newBoolean(USE_UNARY_INTERCEPTOR, "If true it will generate ResponseInterceptors using a UnaryOperator. This can be usefull for manipulating the request before it gets passed, for example doing your own decryption", this.useUnaryInterceptor)); supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.17.1"); supportedLibraries.put(JERSEY3, "HTTP client: Jersey client 3.1.1. JSON processing: Jackson 2.17.1"); @@ -376,6 +379,7 @@ public void processOpts() { } convertPropertyToStringAndWriteBack(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, this::setUseSingleRequestParameter); convertPropertyToBooleanAndWriteBack(USE_SEALED_ONE_OF_INTERFACES, this::setUseSealedOneOfInterfaces); + convertPropertyToBooleanAndWriteBack(USE_UNARY_INTERCEPTOR, this::setUseUnaryInterceptor); writePropertyBack(SINGLE_REQUEST_PARAMETER, getSingleRequestParameter()); writePropertyBack(STATIC_REQUEST, getStaticRequest()); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index e49c8acc859f..71c651310ef8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -37,7 +37,7 @@ import java.util.Objects; import java.util.zip.GZIPOutputStream; {{/useGzipFeature}} import java.util.stream.Collectors; - +{{#useUnaryInterceptor}}import java.util.function.UnaryOperator;{{/useUnaryInterceptor}} import static java.nio.charset.StandardCharsets.UTF_8; /** @@ -64,8 +64,15 @@ public class ApiClient { protected int port; protected String basePath; protected Consumer interceptor; +{{#useUnaryInterceptor}} + protected UnaryOperator> responseInterceptor; + protected UnaryOperator> asyncResponseInterceptor; +{{/useUnaryInterceptor}} +{{^useUnaryInterceptor}} protected Consumer> responseInterceptor; protected Consumer> asyncResponseInterceptor; +{{/useUnaryInterceptor}} + protected Duration readTimeout; protected Duration connectTimeout; @@ -361,12 +368,12 @@ public class ApiClient { * Set a custom response interceptor. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. */ - public ApiClient setResponseInterceptor(Consumer> interceptor) { + public ApiClient setResponseInterceptor({{#useUnaryInterceptor}}UnaryOperator{{/useUnaryInterceptor}}{{^useUnaryInterceptor}}Consumer{{/useUnaryInterceptor}}> interceptor) { this.responseInterceptor = interceptor; return this; } @@ -376,7 +383,7 @@ public class ApiClient { * * @return The custom interceptor that was set, or null if there isn't any. */ - public Consumer> getResponseInterceptor() { + public {{#useUnaryInterceptor}}UnaryOperator{{/useUnaryInterceptor}}{{^useUnaryInterceptor}}Consumer{{/useUnaryInterceptor}}> getResponseInterceptor() { return responseInterceptor; } @@ -384,12 +391,12 @@ public class ApiClient { * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. */ - public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + public ApiClient setAsyncResponseInterceptor({{#useUnaryInterceptor}}UnaryOperator{{/useUnaryInterceptor}}{{^useUnaryInterceptor}}Consumer{{/useUnaryInterceptor}}> interceptor) { this.asyncResponseInterceptor = interceptor; return this; } @@ -399,7 +406,7 @@ public class ApiClient { * * @return The custom interceptor that was set, or null if there isn't any. */ - public Consumer> getAsyncResponseInterceptor() { + public {{#useUnaryInterceptor}}UnaryOperator{{/useUnaryInterceptor}}{{^useUnaryInterceptor}}Consumer{{/useUnaryInterceptor}}> getAsyncResponseInterceptor() { return asyncResponseInterceptor; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index b9ef07965948..7fb66dd22169 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -48,6 +48,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.Locale; +{{#useUnaryInterceptor}}import java.util.function.UnaryOperator;{{/useUnaryInterceptor}} import java.util.function.Consumer; {{#useGzipFeature}} import java.util.function.Supplier; @@ -86,8 +87,14 @@ public class {{classname}} { private final String memberVarBaseUri; private final Consumer memberVarInterceptor; private final Duration memberVarReadTimeout; +{{#useUnaryInterceptor}} + private final UnaryOperator> memberVarResponseInterceptor; + private final UnaryOperator> memberVarAsyncResponseInterceptor; +{{/useUnaryInterceptor}} +{{^useUnaryInterceptor}} private final Consumer> memberVarResponseInterceptor; private final Consumer> memberVarAsyncResponseInterceptor; +{{/useUnaryInterceptor}} public {{classname}}() { this(Configuration.getDefaultApiClient()); @@ -433,7 +440,12 @@ public class {{classname}} { localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()); if (memberVarResponseInterceptor != null) { + {{#useUnaryInterceptor}} + localVarResponse = memberVarResponseInterceptor.apply(localVarResponse); + {{/useUnaryInterceptor}} + {{^useUnaryInterceptor}} memberVarResponseInterceptor.accept(localVarResponse); + {{/useUnaryInterceptor}} } InputStream localVarResponseBody = null; try { @@ -526,7 +538,12 @@ public class {{classname}} { localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofInputStream()).thenComposeAsync(localVarResponse -> { if (memberVarAsyncResponseInterceptor != null) { + {{#useUnaryInterceptor}} + localVarResponse = memberVarAsyncResponseInterceptor.apply(localVarResponse); + {{/useUnaryInterceptor}} + {{^useUnaryInterceptor}} memberVarAsyncResponseInterceptor.accept(localVarResponse); + {{/useUnaryInterceptor}} } if (localVarResponse.statusCode()/ 100 != 2) { return CompletableFuture.failedFuture(getApiException("{{operationId}}", localVarResponse)); @@ -935,4 +952,4 @@ public class {{classname}} { {{/vendorExtensions.x-group-parameters}} {{/operation}} } -{{/operations}} +{{/operations}} \ No newline at end of file diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java index 261dec248d2a..d3bc84e2de98 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -66,6 +66,7 @@ public class ApiClient { protected Consumer interceptor; protected Consumer> responseInterceptor; protected Consumer> asyncResponseInterceptor; + protected Duration readTimeout; protected Duration connectTimeout; @@ -359,7 +360,7 @@ public Consumer getRequestInterceptor() { * Set a custom response interceptor. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. @@ -382,7 +383,7 @@ public Consumer> getResponseInterceptor() { * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/AuthApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/AuthApi.java index a53cf681df7e..16b80f7ed0b8 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/AuthApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/AuthApi.java @@ -43,6 +43,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/BodyApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/BodyApi.java index c29f40fc17c6..ea1d924166d6 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/BodyApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/BodyApi.java @@ -53,6 +53,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/FormApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/FormApi.java index 9a68ac1a4cf6..8d842ed8187d 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/FormApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/FormApi.java @@ -50,6 +50,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/HeaderApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/HeaderApi.java index 92eb9523b2df..fcec5febaeea 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/HeaderApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/HeaderApi.java @@ -50,6 +50,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/PathApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/PathApi.java index b462605735fd..6eb9581383cb 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/PathApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/PathApi.java @@ -50,6 +50,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/QueryApi.java b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/QueryApi.java index bdaa4c94f52b..59a38b1cc6ea 100644 --- a/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/QueryApi.java +++ b/samples/client/echo_api/java/native/src/main/java/org/openapitools/client/api/QueryApi.java @@ -56,6 +56,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java index 3f503b919cc4..fe7c9c6037c0 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/ApiClient.java @@ -66,6 +66,7 @@ public class ApiClient { protected Consumer interceptor; protected Consumer> responseInterceptor; protected Consumer> asyncResponseInterceptor; + protected Duration readTimeout; protected Duration connectTimeout; @@ -359,7 +360,7 @@ public Consumer getRequestInterceptor() { * Set a custom response interceptor. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. @@ -382,7 +383,7 @@ public Consumer> getResponseInterceptor() { * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 2ee4a0b7a141..82ad53ed02b3 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -44,6 +44,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; import java.util.concurrent.CompletableFuture; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/DefaultApi.java index 034ac23ffe17..2a933f54bab1 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -44,6 +44,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; import java.util.concurrent.CompletableFuture; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java index f8bf6ea550ef..3bf44df8429e 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeApi.java @@ -61,6 +61,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; import java.util.concurrent.CompletableFuture; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 3982c43125c5..0e462c71f958 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -50,6 +50,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; import java.util.concurrent.CompletableFuture; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java index b378f6323824..943d4abd5fd4 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/PetApi.java @@ -52,6 +52,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; import java.util.concurrent.CompletableFuture; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java index cb5d2a6086ed..bd5aaa274dc5 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/StoreApi.java @@ -50,6 +50,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; import java.util.concurrent.CompletableFuture; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java index b80d6dd06b25..36b4519a5832 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java @@ -51,6 +51,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; import java.util.concurrent.CompletableFuture; diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java index f3e37e58684c..cf6c738266a1 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/ApiClient.java @@ -66,6 +66,7 @@ public class ApiClient { protected Consumer interceptor; protected Consumer> responseInterceptor; protected Consumer> asyncResponseInterceptor; + protected Duration readTimeout; protected Duration connectTimeout; @@ -359,7 +360,7 @@ public Consumer getRequestInterceptor() { * Set a custom response interceptor. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. @@ -382,7 +383,7 @@ public Consumer> getResponseInterceptor() { * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/PetApi.java index 6f93450ff3e2..c655e2ab5145 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/PetApi.java @@ -52,6 +52,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/StoreApi.java index 31f0574aee8a..0db6dd0999a6 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/StoreApi.java @@ -50,6 +50,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/UserApi.java index 44afc71d96db..c48d29ecc789 100644 --- a/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native-jakarta/src/main/java/org/openapitools/client/api/UserApi.java @@ -51,6 +51,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiClient.java index f3e37e58684c..cf6c738266a1 100644 --- a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/ApiClient.java @@ -66,6 +66,7 @@ public class ApiClient { protected Consumer interceptor; protected Consumer> responseInterceptor; protected Consumer> asyncResponseInterceptor; + protected Duration readTimeout; protected Duration connectTimeout; @@ -359,7 +360,7 @@ public Consumer getRequestInterceptor() { * Set a custom response interceptor. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. @@ -382,7 +383,7 @@ public Consumer> getResponseInterceptor() { * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. diff --git a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/api/PetApi.java index 435606543feb..a007929a53e6 100644 --- a/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native-useGzipFeature/src/main/java/org/openapitools/client/api/PetApi.java @@ -44,6 +44,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index 3f503b919cc4..fe7c9c6037c0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -66,6 +66,7 @@ public class ApiClient { protected Consumer interceptor; protected Consumer> responseInterceptor; protected Consumer> asyncResponseInterceptor; + protected Duration readTimeout; protected Duration connectTimeout; @@ -359,7 +360,7 @@ public Consumer getRequestInterceptor() { * Set a custom response interceptor. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. @@ -382,7 +383,7 @@ public Consumer> getResponseInterceptor() { * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. * *

This is useful for logging, monitoring or extraction of header variables

- * + *

If you are using the UnaryInterceptor you can even manipulate the response to a certain degree

* @param interceptor A function invoked before creating each request. A value * of null resets the interceptor to a no-op. * @return This object. diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index d641a4662ad3..9c5880a01b15 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -44,6 +44,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/DefaultApi.java index ead7c4eddb43..054d8ff443c3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -44,6 +44,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java index 3d86e3ca616e..e492f3e9d799 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java @@ -61,6 +61,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 45959c76a8d8..44140e846548 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -50,6 +50,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java index 74529ccbf514..824291708471 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java @@ -52,6 +52,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java index 8192c66dbfd8..f974ed03d38c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java @@ -50,6 +50,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT") diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java index 5e8ac868ed7b..8195f19916e8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java @@ -51,6 +51,7 @@ import java.util.Map; import java.util.Set; import java.util.Locale; + import java.util.function.Consumer; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.18.0-SNAPSHOT")