Releases: nabobery/kotlin-sdkgen
Release list
kotlin-sdkgen 0.4.0
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.payloadPropertynow returnFlowof the JSON value carried by each SSEdata:field instead ofFlowof the declared envelope model. In the OpenRouter conformance SDK, this correctsChatClient.sendChatCompletionRequestStream,ImagesClient.createImagesStream,AnthropicMessagesClient.createMessagesStream, andBetaResponsesClient.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.defaultServerandruntime.userAgentSuffixconfiguration now reach generated constructors and request identity, with fail-closed validation for invalid URLs and line breaks.x-sdkgen-streaming.payloadPropertyprojects an SSE envelope property into the generated stream element type and rejects missing or non-object envelope contracts.SdkGenConfiguration.generatedSourcesexposes 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
datapayload 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.SsegainspayloadPropertywhile 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
nullfor nullable properties instead of incorrectly raisingNoMatchException. - 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-sdkgenversion0.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
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 (
SchemaModelcompositions,AllOfPropertyResolutionwith a now-requiredwinningPropertySchemaId, audit sources), breaking source and binary compatibility of thegenerator-model/generator-openapisurface. Generated SDK surfaces are additive except for the wire-contract changes below. - Wire contract: a degenerate null-only
anyOfmember now canonicalizes into property nullability instead of aJsonElement?catch-all branch; affected unions become strict two-branch unions whose non-matching payloads throw the union'sNoMatchException(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 enumpurposefield 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
allOfintersection algebra with audited overrides: duplicateallOfproperties resolve through a proven set-theoretic algebra, and contract-judgment cases are recorded explicitly via the newx-sdkgen-allof-resolutioncanonical extension (per-property branch election by$refor 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 newRawTextCodecruntime 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
/messagesand/responsesstreaming operations and both/audio/transcriptionsmedia 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
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, andStreammethods, with[DONE]sentinel handling. offsetLimitpagination generation (x-sdkgen-paginationwithoffset/limitrequest parameters and an optional total field), producingPages/Itemsflows alongside the existing cursor and header-URL styles.- Activation of all 17 OpenRouter paginated operations — 16
offsetLimitand one cursor — through canonical overlay metadata. iosX64andmacosX64publication for theruntime-core,runtime-testing, andtransport-ktorKMP modules, adding the-runtime-iosx64,-runtime-macosx64,-testing-iosx64,-testing-macosx64,-transport-ktor-iosx64, and-transport-ktor-macosx64coordinates underio.github.nabobery.
Changed
- Updated Ktor to
3.5.2and 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
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.