# 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.

- **URL**: https://www.freshcrate.ai/projects/kotlinx-schema
- **Author**: Kotlin
- **Category**: Uncategorized
- **Latest version**: `v0.5.0` (2026-04-07)
- **License**: Apache-2.0
- **Source**: https://github.com/Kotlin/kotlinx-schema
- **Homepage**: https://kotlin.github.io/kotlinx-schema/
- **Language**: Kotlin
- **GitHub**: 115 stars, 10 forks
- **Registry**: github
- **Tags**: `code-generation`, `json-schema`, `kotlin`, `kotlin-symbol-processing`, `kotlin-symbol-processor`

## Description

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.

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `v0.5.0` | 2026-04-07 | High | ## What's Changed  ### Highlights  - **Open polymorphism support** — Abstract classes and interfaces can now generate JSON Schema when subtypes are registered via `SerializersModule`. The generator resolves subtypes from the module and produces deterministic oneOf/anyOf output. — @kpavlov  - **`@SerialDescription` annotation** — A new `@SerialInfo`-compatible description annotation that the serialization-based generator reads automatically, without requiring custom DescriptionExtractor con |
| `v0.4.4` | 2026-03-18 | Low | ## What's Changed  * fix: returning empty description for multi-element annotations by @kpavlov (#269) * fix: description is not extracted from non-public annotation interfaces by @kpavlov (#269)  **Full Changelog**: https://github.com/Kotlin/kotlinx-schema/compare/v0.4.3...v0.4.4 |
| `v0.4.3` | 2026-03-17 | Low | ## What's Changed  * **fix(reflection):** Add support for nullable and record properties in reflection JSON schema generation (#263) by @kpavlov in https://github.com/Kotlin/kotlinx-schema/pull/264 * **chore(deps):** Bump kotest from 6.1.6 to 6.1.7 by @dependabot[bot] in https://github.com/Kotlin/kotlinx-schema/pull/254  **Full Changelog**: https://github.com/Kotlin/kotlinx-schema/compare/v0.4.2...v0.4.3 |
| `0.4.2` | 2026-03-13 | Low | ## What's Changed  * fix: propagate node.description for inline PrimitiveNode, ListNode, MapNode (https://github.com/Kotlin/kotlinx-schema/issues/251) by @kpavlov * chore(deps): Bump kotest from 6.1.5 to 6.1.6 in /examples/gradle-google-ksp by @dependabot[bot] in https://github.com/Kotlin/kotlinx-schema/pull/246  **Full Changelog**: https://github.com/Kotlin/kotlinx-schema/compare/v0.4.1...0.4.2 |
| `v0.4.1` | 2026-03-10 | Low | ## What's Changed  * fix: missing property descriptions for class types, update tests to check for it by @EugeneTheDev in https://github.com/Kotlin/kotlinx-schema/pull/238 (#240) * docs: Improve Module.md annotation descriptions and update Dokka links by @kpavlov in https://github.com/Kotlin/kotlinx-schema/pull/241  **Full Changelog**: https://github.com/Kotlin/kotlinx-schema/compare/v0.4.0...v0.4.1 |
| `v0.4.0` | 2026-03-09 | Low | ## What's Changed  ### Breaking Changes  - **Polymorphic types support** (#212 , #233 by @EugeneTheDev & @kpavlov): Sealed class hierarchies now generate `oneOf`/`anyOf` with a constant discriminator property per subtype. Breaking changes:     - `JsonSchemaConfig.Strict` now sets `respectDefaultPresence = false` — all fields required regardless of Kotlin default values     - `includePolymorphicDiscriminator = true` by default     - Sealed subclass names in schemas now use **fully qualifie |
| `v0.3.2` | 2026-02-20 | Low | ## What's Changed  ### Added                                                                                                                                    - **Custom description extraction**: `SerializationClassJsonSchemaGenerator` now accepts `SerializationClassSchemaIntrospector.Config` with a pluggable `DescriptionExtractor` — map any annotation to the schema `description` field without modifying your models (#196) by @EugeneTheDev and @kpavlov  ### Documentation |
| `v0.3.1` | 2026-02-12 | Low | ## What's Changed  ### Added - Support WasmJS/Browser and watchOS X64 targets by @kpavlov in https://github.com/Kotlin/kotlinx-schema/pull/182 - MCP server example with auto-generated JSON schema by @kpavlov in https://github.com/Kotlin/kotlinx-schema/pull/175  ### Fixed - Move _slf4j.simple_ dependency to test scope  by @kpavlov in https://github.com/Kotlin/kotlinx-schema/pull/166  Multiple dependencies were updated along the way.  **Full Changelog**: https://github.com/Kotlin/kotlin |
| `v0.3.0` | 2026-02-03 | Low | ## What's Changed  ### Breaking Changes  - Migrate "kotlinx-schema-generator-core" and "kotlinx-schema-generator-json to Kotlin Multiplatform (#147) by @kpavlov in https://github.com/Kotlin/kotlinx-schema/pull/149  ### New features  - Extract parameter, field and property descriptions from KDoc (#109) by @kpavlov in https://github.com/Kotlin/kotlinx-schema/pull/148  ### Changed  - refactor(json): Migrate kx.serialization tests to `commonTest` (#147) by @kpavlov in https://github.com/ |
| `v0.2.0` | 2026-02-02 | Low | ## What's Changed  ### Breaking Changes - **JsonSchema: `additionalProperties` API**: Replaced `JsonPrimitive` with type-safe `AdditionalPropertiesConstraint` sealed interface by @kpavlov    - Use `AllowAdditionalProperties`, `DenyAdditionalProperties`, or `AdditionalPropertiesSchema(schema)` instead of boolean primitives   - Enables compile-time type safety and better IDE support  ### Added - **kotlinx.serialization support**: New `SerializationClassJsonSchemaGenerator` for runtime intr |

## Citation

- HTML: https://www.freshcrate.ai/projects/kotlinx-schema
- Markdown: https://www.freshcrate.ai/projects/kotlinx-schema.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/kotlinx-schema/deps

_Generated by freshcrate.ai. Indexes github releases for AI-agent ecosystem packages._
