Skip to content

fix: upgrade @asyncapi/modelina to 6.0.0-next.14 - #427

Merged
jonaslagoni merged 2 commits into
mainfrom
upgrade_modelina
Jul 22, 2026
Merged

jonaslagoni merged 2 commits into
mainfrom
upgrade_modelina

Conversation

@jonaslagoni

Copy link
Copy Markdown
Contributor

What

Upgrades @asyncapi/modelina from 6.0.0-next.12 to 6.0.0-next.14 and adapts the project (generated code + tests) to Modelina's reworked model-serialization surface.

Why

Keep the generator current with Modelina. next.14 changed how generated TypeScript models serialize and deserialize, so the regenerated output and the tests asserting against it must be brought in line.

Changes

  • Dependency bump: @asyncapi/modelina ^6.0.0-next.12 → ^6.0.0-next.14 (package.json + package-lock.json, and test/runtime/typescript/package-lock.json).
  • Regenerated all runtime TypeScript models to the new serialization surface:
    • marshal() now delegates to a new toJson(): Record<string, unknown> + JSON.stringify() — marshalled output no longer has a space after each colon ({"a":"b"} instead of {"a": "b"}).
    • Added fromJson(); unmarshal() now delegates to it.
    • additionalProperties changed from a Map (.set()/.get()/.entries()) to a plain object / Record (Object.entries, obj[key] = value).
  • Updated unit snapshots (headers.spec.ts.snap, payload.spec.ts.snap) to the new output.
  • Fixed hardcoded JSON-string assertions in the NATS runtime specs (test/client/nats.spec.ts, test/channels/regular/nats.spec.ts) — removed the now-absent space after the colon. All other protocol specs compare marshal() to marshal() (roundtrip, format-agnostic) and needed no changes.

Testing

Verified locally across all three tiers (the pre-existing FormatTime failure below is unrelated to this upgrade):

  • npm run build — clean (TypeScript compiles against next.14; oclif manifest regenerated).
  • npm test — 675 passed, 1 skipped; 4 snapshots updated for the new serialization format.
  • npm run lint (eslint --max-warnings 0 + typecheck:test) — clean.
  • npm run test:blackbox — 12/12 pass (generated code type-checks against next.14).
  • Runtime (live brokers via Docker): NATS (client + channels), Kafka, MQTT, AMQP, EventSource, WebSocket, HTTP — all pass; plus regular (headers/payloads/parameters/types), organization, and payload-types.
  • Confirmed regeneration is deterministic — regenerating with the freshly built CLI reproduces exactly the committed output.

Pre-existing, unrelated failure: test/runtime/typescript/test/payload-types/formats.spec.ts → "FormatTime should unmarshal to Date object". Modelina generates type FormatTime = string for format: time (only date-time maps to Date), and FormatTime.ts is byte-identical between next.12 and next.14 — so this failure exists independently of this upgrade and is left out of scope here.

Notes

  • Behavioral change to generated code (user-facing). Consumers of generated models are affected:

    • additionalProperties is now a plain object (Record) rather than a Map — code using .set() / .get() / .entries() must switch to object access.
    • Marshalled JSON now has no whitespace after colons.

    If the release should signal this to downstream users, consider marking the commit as a breaking change (BREAKING CHANGE: footer) rather than a plain dependency bump.

  • The branch currently carries a single wip commit — reword to a conventional-commit message before merge so semantic-release classifies it correctly.

  • The pre-existing FormatTime (format: time → Date) test failure is a separate issue and not addressed here.

@jonaslagoni
jonaslagoni requested a review from ALagoni97 as a code owner July 22, 2026 20:23
@vercel

vercel Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
the-codegen-project Ready Ready Preview, Comment Jul 22, 2026 8:28pm
the-codegen-project-mcp Ready Ready Preview, Comment Jul 22, 2026 8:28pm

@jonaslagoni jonaslagoni changed the title chore(deps): upgrade @asyncapi/modelina to 6.0.0-next.14 fix: upgrade @asyncapi/modelina to 6.0.0-next.14 Jul 22, 2026
@jonaslagoni
jonaslagoni merged commit 42bc579 into main Jul 22, 2026
17 checks passed
@jonaslagoni
jonaslagoni deleted the upgrade_modelina branch July 22, 2026 20:29
@jonaslagoni

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.78.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

This branch was successfully deployed

2 active deployments
Preview – the-codegen-project — 1aa22c14 Deployed Jul 22, 2026 by vercel[bot]
Preview – the-codegen-project-mcp — 1aa22c14 Deployed Jul 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant