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
@GET(Endpoints.USER_EMAIL_EXISTS)
suspend fun userExistsByEmail(
@Path("email") email: String
): Response<Boolean>
When calling the endpoint from the client I get a strange error message which is:
io.ktor.client.call.NoTransformationFoundException: Expected response body of the type 'class kotlin.Boolean' but was 'class kotlin.Boolean'
In response from http://10.0.2.2:8080/api/v1/user/existsByEmail/[email protected]
Response status 200
Response header ContentType: application/json
Request header Accept: application/json
What did you expect to happen?
I'd expect ktorfit to parse the result as boolean wrapped as response successfully.
Is there anything else we need to know about?
Additional finding: When I remove the Response wrapper arount the Boolean, the endpoint works fine.
Found out today: When I remove the Response wrapper arount the Boolean, the endpoint works fine.
Interesting is: If there is a complex object wrapped in the Response, the API works fine.
Ktorfit version
2.2.0
What happened and how can we reproduce this issue?
Hi I have this simple REST endpoint in my backend application:
My ktorfit client look like that:
When calling the endpoint from the client I get a strange error message which is:
What did you expect to happen?
I'd expect ktorfit to parse the result as boolean wrapped as response successfully.
Is there anything else we need to know about?
Additional finding: When I remove the Response wrapper arount the Boolean, the endpoint works fine.
I already posted a KTOR issue but the devs could not reproduce it and mentioned to file a bug here because it might be ktorfit related: https://youtrack.jetbrains.com/issue/KTOR-7835/NoTransformationFoundException-expected-kotlin.Boolean-but-found-kotlin.Boolean
The text was updated successfully, but these errors were encountered: