Kotlin/kotlinx-schema
Kotlin Multiplatform library that generates JSON Schemas from your methods and classes both at compile-time via Kotlin Symbol Processing(KSP) and at runtime via reflection or kotlinx.serialization.
Supports LLM function calling schemas (OpenAI/Anthropic format) with automatic strict mode and parameter validation, alongside comprehensive type handling including sealed class hierarchies with discriminators and `$ref`/`$defs` deduplication. Multi-framework annotation detection recognizes `@Description`, Jackson, LangChain4j, and custom annotations without code changes, enabling schema generation for third-party libraries. Offers three generation modes—compile-time KSP (zero runtime overhead, multiplatform), runtime reflection (JVM-only), and serialization-based (kotlinx.serialization)—with a type-safe Kotlin DSL for programmatic schema construction.
105 stars.
Stars
105
Forks
8
Language
Kotlin
License
Apache-2.0
Category
Last pushed
Mar 18, 2026
Commits (30d)
0
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/ai-coding/Kotlin/kotlinx-schema"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Higher-rated alternatives
dromara/fast-request
IntelliJ IDEA plugin Fast Request
square/kotlinpoet
A Kotlin API for generating .kt source files.
ZacSweers/MoshiX
Extensions for Moshi including IR plugins, moshi-sealed, and more.
cnrture/QuickProjectWizard
🚀 Ultimate Android development companion for Android Studio. Create projects with modern...
F43nd1r/autodsl
Auto-generate DSLs for Kotlin using annotations