
Enforces wire compatibility for JSON-serializable data models by diffing current schema against a git baseline, honoring JSON reader config, and failing CI with detailed reports and annotations.
Catch breaking JSON and CBOR changes before they ship. A CI gate for kotlinx-serialization @Serializable models, like buf breaking but for JSON and CBOR.
@Serializable
data class Order(
val id: String,
val amountCents: Long,
- val note: String? = null,
)$ ./gradlew serialkompatCheck
serialkompat: 1 active finding(s) (1 breaking, 0 warning), 0 acknowledged
BREAK PROPERTY_REMOVED com.example.Order (backward)
field 'note' was removed from com.example.Order
fix: Removing a field drops its data for tolerant readers; keep it (or bridge a rename with @JsonNames) until nothing uses it; else bump major.
BUILD FAILEDJson { } / Cbor { } config.Not a runtime validator, migration tool or JSON-schema linter.
The plugin is on the Gradle Plugin Portal, so no repository setup is needed. In the module that holds your @Serializable models:
// build.gradle.kts
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("com.chrisjenx.serialkompat") version "0.3.1"
}
serialkompat {
types.set(listOf("com.example.Order")) // root @Serializable types to guard
}serialkompatCheck runs as part of ./gradlew check. The quick start walks through the first PR (the check has to be skipped on the PR that adds the plugin).
serialkompatCheck.baselineRef) in a temporary git worktree.SerialDescriptor.Json { } or Cbor { } config.Details: Architecture.
| Quick start | Add the plugin, merge, read the report |
| Installation | Multi-module, KMP, and the standalone CLI |
| Concepts | Baseline, backward vs forward, BREAK vs WARN |
| GitHub Action | PR comments and annotations |
| Got a BREAK? | Fix, rename or accept it |
| Adopting gradually | Roll out on an existing codebase |
| Configuration | Every option |
| Tasks & CLI | Tasks, -P properties, CLI flags, exit codes |
| Rules | What counts as breaking, per direction |
| Report formats | Console, JSON, SARIF, GitHub |
| CBOR | The same gate for CBOR |
| Troubleshooting | Symptom, cause, fix |
| Module | What |
|---|---|
serialkompat-core |
Pure-Kotlin Snapshot model, differ, classifier, rule set, report. No I/O. |
serialkompat-extractor |
Runtime SerialDescriptor → Snapshot extraction (JVM). |
serialkompat-gradle |
The Gradle plugin (serialkompatCheck). |
serialkompat-cli |
Standalone serialkompat diff <baseline> <current> for non-Gradle / cross-repo use. |
serialkompat-annotations |
@SerialkompatIgnore / @SerialkompatChecked discovery markers (Kotlin Multiplatform). |
./gradlew build # compile, test, spotless, API check (BCV), docs gates, docs-sample tests
./gradlew spotlessApply # auto-format
./gradlew apiDump # update public-API baselines after an intended API change
./gradlew koverHtmlReportRequires JDK 17+. Toolchain versions are pinned in gradle/wrapper/gradle-wrapper.properties and gradle/libs.versions.toml. Maintainers: see RELEASING.md.
Contributions welcome — this project is built test-first. See CONTRIBUTING.md and our Code of Conduct. Good starting points are issues labelled good first issue.
Apache License 2.0 © 2026 Chris Jenkins and serialkompat contributors.
Catch breaking JSON and CBOR changes before they ship. A CI gate for kotlinx-serialization @Serializable models, like buf breaking but for JSON and CBOR.
@Serializable
data class Order(
val id: String,
val amountCents: Long,
- val note: String? = null,
)$ ./gradlew serialkompatCheck
serialkompat: 1 active finding(s) (1 breaking, 0 warning), 0 acknowledged
BREAK PROPERTY_REMOVED com.example.Order (backward)
field 'note' was removed from com.example.Order
fix: Removing a field drops its data for tolerant readers; keep it (or bridge a rename with @JsonNames) until nothing uses it; else bump major.
BUILD FAILEDJson { } / Cbor { } config.Not a runtime validator, migration tool or JSON-schema linter.
The plugin is on the Gradle Plugin Portal, so no repository setup is needed. In the module that holds your @Serializable models:
// build.gradle.kts
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("com.chrisjenx.serialkompat") version "0.3.1"
}
serialkompat {
types.set(listOf("com.example.Order")) // root @Serializable types to guard
}serialkompatCheck runs as part of ./gradlew check. The quick start walks through the first PR (the check has to be skipped on the PR that adds the plugin).
serialkompatCheck.baselineRef) in a temporary git worktree.SerialDescriptor.Json { } or Cbor { } config.Details: Architecture.
| Quick start | Add the plugin, merge, read the report |
| Installation | Multi-module, KMP, and the standalone CLI |
| Concepts | Baseline, backward vs forward, BREAK vs WARN |
| GitHub Action | PR comments and annotations |
| Got a BREAK? | Fix, rename or accept it |
| Adopting gradually | Roll out on an existing codebase |
| Configuration | Every option |
| Tasks & CLI | Tasks, -P properties, CLI flags, exit codes |
| Rules | What counts as breaking, per direction |
| Report formats | Console, JSON, SARIF, GitHub |
| CBOR | The same gate for CBOR |
| Troubleshooting | Symptom, cause, fix |
| Module | What |
|---|---|
serialkompat-core |
Pure-Kotlin Snapshot model, differ, classifier, rule set, report. No I/O. |
serialkompat-extractor |
Runtime SerialDescriptor → Snapshot extraction (JVM). |
serialkompat-gradle |
The Gradle plugin (serialkompatCheck). |
serialkompat-cli |
Standalone serialkompat diff <baseline> <current> for non-Gradle / cross-repo use. |
serialkompat-annotations |
@SerialkompatIgnore / @SerialkompatChecked discovery markers (Kotlin Multiplatform). |
./gradlew build # compile, test, spotless, API check (BCV), docs gates, docs-sample tests
./gradlew spotlessApply # auto-format
./gradlew apiDump # update public-API baselines after an intended API change
./gradlew koverHtmlReportRequires JDK 17+. Toolchain versions are pinned in gradle/wrapper/gradle-wrapper.properties and gradle/libs.versions.toml. Maintainers: see RELEASING.md.
Contributions welcome — this project is built test-first. See CONTRIBUTING.md and our Code of Conduct. Good starting points are issues labelled good first issue.
Apache License 2.0 © 2026 Chris Jenkins and serialkompat contributors.