diff --git a/README.md b/README.md index 82b92484..84ba5466 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ * Attach sources to jar * Fix Bug in SignableRequestImpl * Define ItemAttributes of Catalog API as hashmap containing arrays of jsonObjects +* bugfix for stackoverflow error caused by networkInterceptors in async methods ## Selling Partner API Models This repository contains Swagger models for developers to use to create software to call Selling Partner APIs. Developers can use [swagger codegen](https://github.com/swagger-api/swagger-codegen) to generate client libraries from these models. Please refer to [selling-partner-api-docs](https://github.com/amzn/selling-partner-api-docs) for additional documentation and read the [Selling Partner API Developer Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md) for instructions to get started. diff --git a/clients/sellingpartner-api-aa-java/resources/swagger-codegen/templates/api.mustache b/clients/sellingpartner-api-aa-java/resources/swagger-codegen/templates/api.mustache index 823ee4bc..c2a01dd0 100644 --- a/clients/sellingpartner-api-aa-java/resources/swagger-codegen/templates/api.mustache +++ b/clients/sellingpartner-api-aa-java/resources/swagger-codegen/templates/api.mustache @@ -123,18 +123,6 @@ public class {{classname}} { final String {{localVariablePrefix}}localVarContentType = {{localVariablePrefix}}apiClient.selectHeaderContentType({{localVariablePrefix}}localVarContentTypes); {{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}localVarContentType); - if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { - @Override - public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { - com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); - return originalResponse.newBuilder() - .body(new ProgressResponseBody(originalResponse.body(), progressListener)) - .build(); - } - }); - } - String[] {{localVariablePrefix}}localVarAuthNames = new String[] { {{#authMethods}}"{{name}}"{{#hasMore}}, {{/hasMore}}{{/authMethods}} }; return {{localVariablePrefix}}apiClient.buildCall({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarCollectionQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAuthNames, progressRequestListener); } @@ -298,32 +286,32 @@ public class {{classname}} { this.endpoint = endpoint; return this; } - + public Builder lwaAccessTokenCache(LWAAccessTokenCache lwaAccessTokenCache) { this.lwaAccessTokenCache = lwaAccessTokenCache; return this; } - + public Builder disableAccessTokenCache() { this.disableAccessTokenCache = true; return this; } - + public Builder awsAuthenticationCredentialsProvider(AWSAuthenticationCredentialsProvider awsAuthenticationCredentialsProvider) { this.awsAuthenticationCredentialsProvider = awsAuthenticationCredentialsProvider; return this; } - + public Builder rateLimitConfigurationOnRequests(RateLimitConfiguration rateLimitConfiguration){ this.rateLimitConfiguration = rateLimitConfiguration; return this; } - + public Builder disableRateLimitOnRequests() { this.rateLimitConfiguration = null; return this; } - + public {{classname}} build() { if (awsAuthenticationCredentials == null) { @@ -345,14 +333,14 @@ public class {{classname}} { else { awsSigV4Signer = new AWSSigV4Signer(awsAuthenticationCredentials,awsAuthenticationCredentialsProvider); } - - LWAAuthorizationSigner lwaAuthorizationSigner = null; + + LWAAuthorizationSigner lwaAuthorizationSigner = null; if (disableAccessTokenCache) { lwaAuthorizationSigner = new LWAAuthorizationSigner(lwaAuthorizationCredentials); } else { if (lwaAccessTokenCache == null) { - lwaAccessTokenCache = new LWAAccessTokenCacheImpl(); + lwaAccessTokenCache = new LWAAccessTokenCacheImpl(); } lwaAuthorizationSigner = new LWAAuthorizationSigner(lwaAuthorizationCredentials,lwaAccessTokenCache); } @@ -365,4 +353,4 @@ public class {{classname}} { } } } -{{/operations}} \ No newline at end of file +{{/operations}}