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 all cases.

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 "2.2.20-2.0.3"
    id("io.availe.kreplica") version "5.0.4"
}

Important Links: