-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResponseConverter ignored for suspend functions #23
Comments
I would like to use my ResponseConverter for suspend functions as well. An exmaple interface looks something like this: interface Example {
@GET("test")
suspend fun getTest(): ApiResponse<String>
} And my "possible" suspend ResponseConverter like this: class ApiResponseConverter : ResponseConverter {
override fun supportedType(returnTypeName: String): Boolean {
return returnTypeName == "com.example.ApiResponse"
}
override suspend fun <PRequest : Any> wrapResponse(
returnTypeName: String,
requestFunction: suspend () -> Pair<TypeInfo, HttpResponse>
): Any {
val (info, response)
return ApiResponse.create(response)
}
} The Or the |
@DanielNovak with beta11 it should work now with SuspendResponseConverter |
I close this issue, if it's still relevant, fell free to reopen it |
The suspend API functions ignore any defined
ResponseConverters
- is that by design? A look into the source code confirms this, only the non-suspend code in KtorfitClient.request usesgetResponseConverters()
.*(I created a similar GH issue before and I closed it because it contained a lot of other noise)
The text was updated successfully, but these errors were encountered: