diff --git a/clients/sellingpartner-api-aa-java/resources/swagger-codegen/templates/ApiClient.mustache b/clients/sellingpartner-api-aa-java/resources/swagger-codegen/templates/ApiClient.mustache index 235371bb6..a289f737d 100644 --- a/clients/sellingpartner-api-aa-java/resources/swagger-codegen/templates/ApiClient.mustache +++ b/clients/sellingpartner-api-aa-java/resources/swagger-codegen/templates/ApiClient.mustache @@ -342,9 +342,11 @@ public class ApiClient { if (debugging) { loggingInterceptor = new HttpLoggingInterceptor(); loggingInterceptor.setLevel(Level.BODY); - httpClient.interceptors().add(loggingInterceptor); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); } else { - httpClient.interceptors().remove(loggingInterceptor); + OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); loggingInterceptor = null; } }