Skip to content

Releases: Kotlin/kotlinx-schema

0.4.4

18 Mar 14:43
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

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: v0.4.3...v0.4.4

0.4.3

17 Mar 17:00
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

What's Changed

  • fix(reflection): Add support for nullable and record properties in reflection JSON schema generation (#263) by @kpavlov in #264
  • chore(deps): Bump kotest from 6.1.6 to 6.1.7 by @dependabot[bot] in #254

Full Changelog: v0.4.2...v0.4.3

0.4.2

13 Mar 13:14
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

What's Changed

  • fix: propagate node.description for inline PrimitiveNode, ListNode, MapNode (#251) by @kpavlov
  • chore(deps): Bump kotest from 6.1.5 to 6.1.6 in /examples/gradle-google-ksp by @dependabot[bot] in #246

Full Changelog: v0.4.1...0.4.2

0.4.1

10 Mar 11:18
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

What's Changed

  • fix: missing property descriptions for class types, update tests to check for it by @EugeneTheDev in #238 (#240)
  • docs: Improve Module.md annotation descriptions and update Dokka links by @kpavlov in #241

Full Changelog: v0.4.0...v0.4.1

0.4.0

09 Mar 17:44
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

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 qualified names (e.g. com.example.Animal.Cat) instead of simple names — affects $defs keys, $ref paths, and discriminator const values
  • $defs reuse and kotlin.Any mapping (#234 by @kpavlov): All named types now register in $defs exactly once and are
    referenced via $ref (previously only nullable named types did). kotlin.Any/java.lang.Object now emits {} instead of {"type":"object","additionalProperties":false}.

New Features

  • Polymorphic types (#233): Sealed class hierarchies generate oneOf (JSON Schema) or anyOf (function calling).
    ReflectionFunctionIntrospector now supports suspend fun parameters. Both reflection introspectors support non-recursive polymorphism.

  • Class/function filtering with glob patterns (#218 by @kpavlov): New KSP processor options classesInclude and
    classesExclude allow filtering which classes are processed for schema generation.

  • Constructor parameter annotations (#203 by @@EugeneTheDev): Reflection generator now considers constructor parameter annotations when resolving property descriptions.

Dependency Updates

  • Kotest 6.1.3 → 6.1.5
  • Gradle wrapper 9.3.1 → 9.4.0
  • langchain4j-core 1.11.0 → 1.12.2
  • ai.koog:agents-tools 0.6.2 → 0.6.4
  • Kotlin mcp sdk 0.8.4 → 0.9.0
  • Ktor 3.4.0 → 3.4.1
  • ksp-maven-plugin bumped

by @dependabot[bot]

CI / Infra

  • Fixed workflow configs and project repo path in Google KSP integration test (#213 by @EugeneTheDev)
  • Updated GitHub Actions: gradle/actions 5.0.0 → 5.0.2, actions/upload-artifact 6 → 7, actions/download-artifact
    7 → 8 by @dependabot[bot]

Full Changelog: v0.3.2...v0.4.0

v0.3.2

20 Feb 21:00
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

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

Dependencies

  • Bump ksp from 2.3.5 to 2.3.6 by @dependabot
  • Bump io.github.oshai:kotlin-logging from 7.0.14 to 8.0.01 by @dependabot

New Contributors

Full Changelog: v0.3.1...v0.3.2

0.3.1

12 Feb 17:20
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

What's Changed

Added

  • Support WasmJS/Browser and watchOS X64 targets by @kpavlov in #182
  • MCP server example with auto-generated JSON schema by @kpavlov in #175

Fixed

  • Move slf4j.simple dependency to test scope by @kpavlov in #166

Multiple dependencies were updated along the way.

Full Changelog: v0.3.0...v0.3.1

0.3.0

03 Feb 17:35
Immutable release. Only release title and notes can be modified.

Choose a tag to compare

What's Changed

Breaking Changes

  • Migrate "kotlinx-schema-generator-core" and "kotlinx-schema-generator-json to Kotlin Multiplatform (#147) by @kpavlov in #149

New features

  • Extract parameter, field and property descriptions from KDoc (#109) by @kpavlov in #148

Changed

  • refactor(json): Migrate kx.serialization tests to commonTest (#147) by @kpavlov in #150
  • Extract introspector's shared logic by @kpavlov in #145
  • docs: Update Module.md files for Dokka by @kpavlov in #146

Fixed

  • Package structure: Moved TypeGraphToJsonObjectSchemaTransformer to kotlinx.schema.json

Full Changelog: v0.2.0...v0.3.0

0.2.0

02 Feb 17:48

Choose a tag to compare

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 introspection (#84) by @kpavlov
    • Generate schemas from SerialDescriptor without KSP or reflection
    • Support for primitives, enums, objects, lists, maps, and polymorphic types
    • NB! Type/field descriptions are not supported due to limitations of kotlinx.serialization model!
  • Extended type-safe Schema DSL by @kpavlov
  • Internal API markers: @InternalSchemaGeneratorApi annotation for APIs subject to change by @kpavlov
  • Documentation: Architecture pipeline overview with + diagrams by @kpavlov

Changed

  • Serializers refactoring: Consolidated six enum serializers into a generic TypedEnumSerializer by @kpavlov
    • Moved serializers to a dedicated package for better organization
    • Simplified StringOrListSerializer and AdditionalPropertiesSerializer
  • Introspection architecture: Extracted shared state management into BaseIntrospectionContext<TDecl, TType> by @kpavlov
    • Eliminates code duplication across Reflection, KSP, and Serialization backends
    • Unified cycle detection and type caching

Fixed

  • Complex object parameters in function calling schemas are now handled correctly by @kpavlov
    • Extracted shared type handlers (handleAnyFallback, handleSealedClass, handleEnum, handleObjectOrClass)
    • Improved error messages for unhandled KSType cases

Dependencies

  • Bump kotlinx.kover from 0.9.4 to 0.9.5 by @dependabot
  • Bump gradle from 9.3.0 to 9.3.1

Full Changelog: v0.1.0...v0.2.0

0.1.0

30 Jan 00:08

Choose a tag to compare

Breaking Changes

  • Flattened JsonSchema structure - removed nested JsonSchemaDefinition wrapper
  • Changed nullable representation from "nullable": true to ["type", "null"] (JSON Schema 2020-12)
  • Removed strictSchemaFlag configuration option
  • Changed discriminator fields from default to const in sealed classes
  • Reordered JsonSchema constructor parameters (schema before id)

Added

  • useUnionTypes, useNullableField, includeDiscriminator configuration flags
  • JsonSchemaConfig.Default, JsonSchemaConfig.Strict, JsonSchemaConfig.OpenAPI presets
  • Support for enum and primitive root schemas
  • Centralized formatSchemaId() method for ID generation
  • JsonSchemaConstants for reduced object allocation

Changed

  • Schemas now generate as flat JSON Schema Draft 2020-12 compliant output
  • Updated to ksp-maven-plugin v0.3.0
  • Enhanced KSP documentation with Gradle and Maven examples

Fixed

Dependencies

  • Bump ai.koog:agents-tools from 0.6.0 to 0.6.1
  • Bump com.google.devtools.ksp from 2.3.4 to 2.3.5 (examples)
  • Bump ksp-maven-plugin: 0.3.0 (examples)

Full Changelog: 0.0.5...v0.1.0