You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this issue addresses a deficiency to the earlier enhancement: #1730.
Issue #1730 added the ability to set the OkHttpClient connectionTimeout for the java clients used; however, it didn't add a way to set the OkHttpClient readTimeout and writeTimeout values. By default, OkHttpClient sets all 3 values to a default of 10 seconds. A limit of 10 seconds for reads and writes is a low enough value that many usage scenarios will require the ability to set a larger value for these.
Swagger-codegen version
version 2.2.3 . It is not a regression issue.
Swagger declaration file content or url
Command line used for generation
no specific command line needed for this
Steps to reproduce
generate the java client.
attempt to set the readTimeout and writeTimeout for the ApiClient's internal OkHttpClient.
expected: there are setters to do these that resemble the setConnectTimeout method
actual: there are no setters in the ApiClient that expose these 2 timeout settings
the generated ApiClient class needs the following getter / setter pairs:
/**
* Get read timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getReadTimeout() {
return httpClient.getReadTimeout();
}
/**
* Sets the read timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
*
* @param readTimeout connection timeout in milliseconds
* @return Api client
*/
public ApiClient setReadTimeout(int readTimeout) {
httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS);
return this;
}
/**
* Get write timeout (in milliseconds).
*
* @return Timeout in milliseconds
*/
public int getWriteTimeout() {
return httpClient.getWriteTimeout();
}
/**
* Sets the write timeout (in milliseconds).
* A value of 0 means no timeout, otherwise values must be between 1 and
*
* @param writeTimeout connection timeout in milliseconds
* @return Api client
*/
public ApiClient setWriteTimeout(int writeTimeout) {
httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS);
return this;
}
The text was updated successfully, but these errors were encountered:
Description
this issue addresses a deficiency to the earlier enhancement: #1730.
Issue #1730 added the ability to set the OkHttpClient connectionTimeout for the java clients used; however, it didn't add a way to set the OkHttpClient readTimeout and writeTimeout values. By default, OkHttpClient sets all 3 values to a default of 10 seconds. A limit of 10 seconds for reads and writes is a low enough value that many usage scenarios will require the ability to set a larger value for these.
Swagger-codegen version
version 2.2.3 . It is not a regression issue.
Swagger declaration file content or url
Command line used for generation
no specific command line needed for this
Steps to reproduce
generate the java client.
attempt to set the readTimeout and writeTimeout for the ApiClient's internal OkHttpClient.
expected: there are setters to do these that resemble the setConnectTimeout method
actual: there are no setters in the ApiClient that expose these 2 timeout settings
Related issues/PRs
#1730
Suggest a fix/enhancement
the generated ApiClient class needs the following getter / setter pairs:
The text was updated successfully, but these errors were encountered: