Generate Kotlin DTOs from one interface

KReplica is a KSP plugin that creates type-safe sealed hierarchies for Create, Data, and Patch variants—eliminating boilerplate and runtime surprises.

Bulletproof Your APIs

KReplica uses sealed hierarchies to enable exhaustive when expressions. If you add a new API version, your code won't compile until you handle it—no more runtime surprises.

Setup

Add the KSP and KReplica plugins to your module's build.gradle.kts file to start generating DTOs automatically.

plugins {
    // Use a KSP version compatible with your Kotlin version
    id("com.google.devtools.ksp") version "..."
    id("io.availe.kreplica") version "5.0.0"
}

Important Links: