Skip to content

Releases: nabobery/kotlin-sdkgen

kotlin-sdkgen 0.4.0

Choose a tag to compare

@nabobery nabobery released this 30 Aug 06:45
012461a

Kotlin SDKGen 0.4.0 adds immutable client-scoped configuration, explicit SSE envelope payload projection, correct parameter wire encoding, and configuration-cache-safe generated-source wiring for JVM, Kotlin Multiplatform, and Android consumers.

Breaking

  • Generated streaming API: operations configured with x-sdkgen-streaming.payloadProperty now return Flow of the JSON value carried by each SSE data: field instead of Flow of the declared envelope model. In the OpenRouter conformance SDK, this corrects ChatClient.sendChatCompletionRequestStream, ImagesClient.createImagesStream, AnthropicMessagesClient.createMessagesStream, and BetaResponsesClient.createResponsesStream. Consumers of those generated methods must update their stream element types.

Added

  • SdkClientConfig, an immutable client-scoped runtime configuration value for retry and deadline defaults, request hooks, logical and attempt middleware, lifecycle observers, shared retry budgets, and product identity. Generated root and resource clients share one configuration instance while retaining the 0.3.0 constructor ABI.
  • runtime.defaultServer and runtime.userAgentSuffix configuration now reach generated constructors and request identity, with fail-closed validation for invalid URLs and line breaks.
  • x-sdkgen-streaming.payloadProperty projects an SSE envelope property into the generated stream element type and rejects missing or non-object envelope contracts.
  • SdkGenConfiguration.generatedSources exposes the generation task's output as a Gradle file collection for Android and custom Kotlin Multiplatform source-set wiring.

Changed

  • The OpenRouter conformance overlay now projects the documented data payload for chat, image, Anthropic message, and beta response streams; envelope models remain generated.
  • Generated union predicates and parameter encoding omit redundant casts, statically decided type checks, and unnecessary toString() calls, eliminating the tracked high-volume OpenRouter compiler warnings without changing acceptance semantics.
  • StreamingModel.Sse gains payloadProperty while retaining a three-argument secondary constructor for source compatibility.

Fixed

  • Enum-typed path, query, and header parameters use their documented wire values rather than Kotlin enum case names across scalar, repeated, comma-joined, Stripe-indexed, and deep-object encodings.
  • Nullable union branches accept explicit JSON null for nullable properties instead of incorrectly raising NoMatchException.
  • Gradle generated-source wiring no longer queries mapped task output during configuration, restoring Android compilation and configuration-cache reuse.
  • ktlint integration uses the supported filtering API across plugin application order and class-loader boundaries.

Verification

  • The protected release workflow passed the JVM, JS, Android, Linux, and Apple target lanes, API/ABI checks, live cross-corpus parity, benchmark budgets, isolated publication, signed artifact, SBOM, attestation, and external-consumer gates.
  • The OpenRouter corpus generates all 89 operations with zero blockers. The 0.3.0-to-0.4.0 compatibility packet records four intended breaking stream element-type corrections, 29 additive declarations, two unknown digest-level changes, and explicitly unavailable behavior and generated-SDK ABI layers.

Coordinates

  • Maven Central: io.github.nabobery:kotlin-sdkgen-*:0.4.0
  • Gradle Plugin Portal: io.github.nabobery.kotlin-sdkgen version 0.4.0

See the changelog, ADR 0022, compatibility evidence, and support policy.

Full changelog: v0.3.0...v0.4.0

kotlin-sdkgen 0.3.0

Choose a tag to compare

@nabobery nabobery released this 24 Aug 02:54
827d479

Kotlin SDKGen 0.3.0 introduces a strict, audited allOf schema-composition algebra and media-specific request variants, completing the OpenRouter conformance surface at 89 of 89 operations and reclaiming ten GitHub webhook payload schemas.

Breaking

  • Public model API: the semantic model — public API tracked by the generator's API dumps — gained composition/audit types and fields (SchemaModel compositions, AllOfPropertyResolution with a now-required winningPropertySchemaId, audit sources), breaking source and binary compatibility of the generator-model/generator-openapi surface. Generated SDK surfaces are additive except for the wire-contract changes below.
  • Wire contract: a degenerate null-only anyOf member now canonicalizes into property nullability instead of a JsonElement? catch-all branch; affected unions become strict two-branch unions whose non-matching payloads throw the union's NoMatchException (previously they were silently absorbed).
  • Wire correctness: plain-text request bodies (GitHub markdown/render-raw) transmit raw UTF-8 text instead of a JSON-quoted string; the Stripe multipart enum purpose field is emitted as bare text instead of a JSON-quoted string; string-enum multipart parts and []-named repeated parts encode per their contracts.

Added

  • Strict allOf intersection algebra with audited overrides: duplicate allOf properties resolve through a proven set-theoretic algebra, and contract-judgment cases are recorded explicitly via the new x-sdkgen-allof-resolution canonical extension (per-property branch election by $ref or resolved-content digest, fail-closed on drift). See ADR 0021 and the committed schema-intersection proof table.
  • Media-specific request variants: an operation whose request body declares several incompatible media types now emits one callable method per compatible media group (…Multipart, …Form, sanitized-subtype suffixes) with deterministic naming that fails closed on collisions, instead of rejecting the operation.
  • Explicit request-body wire encodings: JSON (application/json, aliases, +json), raw text (text/* over string schemas, via the new RawTextCodec runtime codec), raw byte streams, form, and multipart. Unsupported representations fail closed with a waivable diagnostic instead of silently JSON-encoding.
  • Full OpenRouter conformance surface: all 89 of 89 operations generate with zero blockers, including the /messages and /responses streaming operations and both /audio/transcriptions media variants.
  • GitHub webhook payload reclamation through the audited overlays: 10 payload schemas (+10 inline sub-schemas) now project; the accepted-waiver ledger shrank from 139 to 119.

Changed

  • Oversized union inspection carriers (beyond a 200-JVM-slot synthetic-descriptor threshold) switch to a no-arg mutable internal carrier to stay within the JVM's 255-slot method descriptor limit; behavior is unchanged.
  • Parity provenance binds each corpus's ordered configured overlay set (audit overlays included), so an overlay-only edit can no longer escape parity input hashing.

Coordinates

  • Maven Central: io.github.nabobery:kotlin-sdkgen-*:0.3.0
  • Gradle Plugin Portal: io.github.nabobery.kotlin-sdkgen

See the changelog, ADR 0021, and support policy.

Full changelog: v0.2.0...v0.3.0

kotlin-sdkgen 0.2.0

Choose a tag to compare

@nabobery nabobery released this 19 Aug 08:14
4079e44

Kotlin SDKGen 0.2.0 extends the OpenRouter conformance SDK to the API's streaming and paginated surfaces, adds the generator support those require, and publishes the Intel Apple Kotlin/Multiplatform targets.

Added

  • Server-sent event streaming for the OpenRouter conformance SDK: chat-completion and image operations now expose generated buffered, WithResponse, and Stream methods, with [DONE] sentinel handling.
  • offsetLimit pagination generation (x-sdkgen-pagination with offset/limit request parameters and an optional total field), producing Pages/Items flows alongside the existing cursor and header-URL styles.
  • Activation of all 17 OpenRouter paginated operations — 16 offsetLimit and one cursor — through canonical overlay metadata.
  • iosX64 and macosX64 publication for the runtime-core, runtime-testing, and transport-ktor KMP modules, adding the -runtime-iosx64, -runtime-macosx64, -testing-iosx64, -testing-macosx64, -transport-ktor-iosx64, and -transport-ktor-macosx64 coordinates under io.github.nabobery.

Changed

  • Updated Ktor to 3.5.2 and refreshed the reproducible Kotlin/JS dependency lock.

Coordinates

  • Maven Central: io.github.nabobery:kotlin-sdkgen-*:0.2.0
  • Gradle Plugin Portal: io.github.nabobery.kotlin-sdkgen

New in this release: the six Intel Apple target coordinates listed above. See the changelog and support policy.

Full changelog: v0.1.0...v0.2.0

kotlin-sdkgen 0.1.0

Choose a tag to compare

@nabobery nabobery released this 18 Aug 16:58
97d8894

Kotlin SDKGen 0.1.0 is the first published release: an OpenAPI 3.1 Kotlin / Kotlin Multiplatform SDK generator with a portable runtime, exercised against corpus-scale real-world API descriptions.

Added

  • OpenAPI 3.1 parsing and normalization into a typed semantic model, with RFC 9535 overlays and explicit support boundaries for OpenAPI 3.0 inputs.
  • Deterministic Kotlin and Kotlin Multiplatform client generation through KotlinPoet, including typed models, resource clients, authentication, pagination, streaming, multipart requests, and compatibility reporting.
  • A portable runtime with Ktor, OkHttp, and Java HTTP transport adapters, plus a transport contract test kit for generated SDKs.
  • A command-line interface for validation, generation, drift detection, contract comparison, and diagnostic explanation.
  • A cacheable Gradle integration that wires generated sources into Kotlin/JVM and Kotlin Multiplatform projects.
  • Reproducible Maven publications with sources, Dokka documentation, signed metadata, SBOMs, and provenance attestations.
  • Corpus-scale conformance coverage using pinned OpenRouter, GitHub REST, and Stripe inputs.

Security

  • Updated the Kotlin/JS dependency lock to resolve known vulnerable transitive packages before the initial publication.

Coordinates

  • Maven Central: io.github.nabobery:kotlin-sdkgen-*:0.1.0
  • Gradle Plugin Portal: io.github.nabobery.kotlin-sdkgen

See the changelog and support policy.