Skip to content

Retrofit+Arrow to Ktor Client+Arrow migration #3354

@postfixNotation

Description

@postfixNotation

As of today I'm using Retroft in combination with Moshi for Serialization and Arrow's Either API for return type specifications, for instance suspended network calls return something like Either<CallError, Dto> where CallError is an Arrow API.

I'm slowly migrating my app to be multiplatform capable, so I'm replacing APIs like java.time.* with kotlinx.datetime.* and so on. My problem is, there's a Retrofit integration with Arrow but not an equivalent for Ktor as far as I know.

So my question is: what would be the best pattern or strategy to replace Retrofit with Ktor client so that my client code doesn't break? This is kind of tricky since CallError is located in arrow.retrofit.adapter.either.networkhandling, so it's part of Retrofit's integration API...
For clarification: I'm also migrating from Moshi to kotlinx.serialization, maybe this helps somehow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions