Skip to content

feign-kotlin: Decoder type returns "Object" when method is suspendingΒ #2019

Open
@JayPeaSize

Description

@JayPeaSize

Currently using feign-kotlin 12.3 and kotlin 1.8.10 while attempting to use a custom decoder. When my method in the the TestClient is suspending type is printed out as "java.lang.Object" however, when not using suspend it returns the proper type of TestObject. This is currently preventing me from being able to get the proper serializer

Client Snippet:

public interface TestClient  {
    @RequestLine("GET /{uuid}")
    public suspend fun testGet(@Param("uuid") uuid: UUID): TestObject
}

Decoder snippet:

public class CustomDecoder: Decoder {
    override fun decode(response: Response, type: Type): Any? {
        if (response.status() != 404 && response.status() != 204) {
                ...
                println(type)
               ...
            }
        } else {
           ...
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssues we need help with tacklingkotlinFor Kotlin related questionsneeds infoInformation is either missing or incomplete.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions