Skip to content

Honor AsyncAPI custom type mappings across all four languages - #284

Merged
kdubb merged 3 commits into
mainfrom
codex/issue-283-asyncapi-custom-types
Oct 19, 2026
Merged

kdubb merged 3 commits into
mainfrom
codex/issue-283-asyncapi-custom-types

Conversation

@kdubb

@kdubb kdubb commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

AsyncAPI named schemas now retain custom Kotlin, Swift, TypeScript, and Python types instead of falling back to generated declarations or default scalar types. Mapping extraction is shared with OpenAPI, including Kotlin client/server precedence and TypeScript module imports.

  • Bundle external component schemas and preserve direct alias mappings without inheriting mappings from composed parents.
  • Use channel messages when AsyncAPI 3 operations omit their message selection, covering the issue's minimal example.
  • Add AsyncAPI 2.x/3.x coverage for all named schema kinds, invalid metadata, aliases, and external references. Compiler/runtime tests verify custom scalar round trips in all four languages, plus actual Kotlin model getter and broker parameter types.

Validation: 131 focused conversion, mapping, broker, reference, composition, and invariant tests passed; generator ktlint passed. Swift, TypeScript, and Python custom-mapping compiler/runtime tests passed for both AsyncAPI versions and retained their OpenAPI coverage.

Closes #283.

Share language mapping extraction with OpenAPI, resolve external component schemas, and preserve direct alias mappings without inheriting composed parent mappings. Support channel message defaults for AsyncAPI 3 operations. Add schema-kind, Kotlin broker and mode-precedence, and cross-language compiler/runtime regressions for AsyncAPI 2 and 3, and document mapping parity.
@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Adds AsyncAPI custom type mappings for Kotlin, Swift, TypeScript, and Python.

  • AsyncAPI schemas keep their custom types in generated code across four languages.
  • AsyncAPI 3 operations use a channel message when they leave message selection out.
  • Converted AsyncAPI models keep their own discriminator values.

Reviews (3) 路 Last reviewed commit: "Preserve constant discriminator metadata..." 路 Reviewed by Greptile

kdubb added 2 commits October 19, 2026 10:14
Keep string discriminators and reference refinements while bundling AsyncAPI schemas, and leave composition validation to its converter. Forward configured document loader options and cover internal documents with external schemas for AsyncAPI 2 and 3.
Retain matching discriminator values declared on union members so shared OpenAPI and AsyncAPI models compose without identity collisions. Keep external discriminator tags on the containing union and add regression assertions.
@kdubb
kdubb enabled auto-merge October 19, 2026 17:47
@sonarqubecloud

Copy link
Copy Markdown

@kdubb
kdubb merged commit 8517487 into main Oct 19, 2026
14 checks passed
@kdubb
kdubb deleted the codex/issue-283-asyncapi-custom-types branch October 19, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AsyncAPI Kotlin broker models ignore custom scalar type mappings in beta.49

1 participant