skema

Changelog

Synced from GitHub Releases.

  1. v0.4.0

    Adds compact JSON serialization to skema. A CompactSerializer encodes a sealed vocabulary of nodes as operator objects, bare names, or numeric literals, and toJsonSchema derives a JSON Schema for it straight from the serializers, with no hand-written spec. This replaces the JsonSpec vocabulary; SchemaDiff and the composition helpers are removed.

    • feat: remove JsonSpec, SchemaDef.toJsonSchema, SchemaDiff, and the plus and namespaced composition helpers.
    • feat: add CompactSerializer, which encodes nodes as operator objects, names, or numeric literals.
    • feat: describe nodes with JsonNode and JsonNodeShape (Fields, Operand, Operands, Literal), and select them by fixed field values.
    • feat: map custom payloads through JsonPayloadMapping, including their schemas.
    • feat: add toJsonSchema for compact serializers and for any KSerializer, using JsonNodeCatalog to find nested compact vocabularies.
    • feat: encode value class nodes as their underlying value.
    • feat: accept unquoted names when the Json instance is lenient.
    • fix: keep null entry values in SchemaDef instead of treating them as missing.
    • docs: rewrite the README around declaring schemas and the compact JSON constraints.
    • chore: update Gradle to 9.7.1 and kbuild to 1.3.6, and publish snapshots from main.

    Full Changelog: https://github.com/Eignex/skema/compare/v0.3.0...v0.4.0

  2. v0.3.0

    Adds a built-in JSON Schema vocabulary to skema. Schemas whose config type is JsonSpec now render to a full JSON Schema document with no mapper required, and schemas with their own config types can opt in per entry through the mapper overload.

    • feat: add the JsonSpec sealed type covering JSON Schema draft 2020-12.
    • feat: add primitive variants Bool, Null, Int, Long, Num, Str, Enum, and Const.
    • feat: support numeric bounds: min, max, exclusiveMin, exclusiveMax, and multipleOf.
    • feat: support string bounds: minLength, maxLength, pattern, and format.
    • feat: add compound variants Array and Object with full per-spec configuration.
    • feat: add composition operators OneOf, AnyOf, AllOf, and Not.
    • feat: add the Nullable wrapper as sugar for spec-or-null.
    • feat: add IfThenElse for conditional schemas.
    • feat: add the Ref variant and a defs parameter on toJsonSchema for root-level definitions.
    • feat: add the Annotated wrapper for title, description, default, examples, deprecated, readOnly, writeOnly, and comment.
    • feat: add the toJsonSchema extension on SchemaDef returning a draft 2020-12 document.

    Full Changelog: https://github.com/Eignex/skema/compare/v0.2.0...v0.3.0

  3. v0.2.0

    Improves Java interop on the SchemaDef extension functions, refreshes the toolchain, and adds KDoc across the public API.

    • feat: improve Java interop on the SchemaDef extension functions.
    • docs: add KDoc to public Schema, SchemaDef, and SchemaDiff members.
    • chore: use kotlinx-serialization pinned by the KMP plugin.
    • chore: drop the deprecated macosX64 target.
    • chore: bump KMP to 1.2.1 and Gradle to 9.5.1.
    • chore: bump kbuild to 1.1.5 and run lintDocs in CI.

    Full Changelog: https://github.com/Eignex/skema/compare/v0.1.1...v0.2.0

  4. v0.1.1

    Patch release fixing inline-function visibility so the register helper works from outside the module.

    • fix: route register's inlined add through a @PublishedApi internal.

    Full Changelog: https://github.com/Eignex/skema/compare/v0.1.0...v0.1.1

  5. v0.1.0

    Initial release of skema, a Kotlin Multiplatform library for schemas that work as both typed Kotlin code and serialized wire data, with the same definition surface serving compile-time access on the producer and runtime by-name decoding on the consumer.

    • feat: provide Schema<C> with assignment (val flag = bool("flag")) and delegate (val flag by bool()) declarators.
    • feat: add SchemaDef<C> as a Map<String, C>-keyed wire wrapper.
    • feat: pin the $type discriminator and suppress defaults via SchemaJson.
    • feat: add SchemaDef.diff for per-entry change detection.
    • feat: add SchemaDef.plus and namespaced for plugin-style composition with strict overlap checking.
    • feat: target JVM, JS, WasmJs, WasmWasi, and native via Kotlin Multiplatform.

    Full Changelog: https://github.com/Eignex/skema/compare/913a66b...v0.1.0