parser-js icon indicating copy to clipboard operation
parser-js copied to clipboard

feat(parser): add title() method to v3 Channel model

Open q404365631 opened this issue 6 months ago • 2 comments

What

Adds a title() method to the v3 Channel model so consumers can read the title field from a channel object.

Why

The AsyncAPI 3.0 spec defines title as an optional field on ChannelObject (and the parser already has it on the TypeScript type), but the Channel model had no accessor. Closing this gap so the parser exposes all the fields the spec allows.

Fixes #1067

Changes

  • packages/parser/src/models/channel.ts: Added optional title?(): string | undefined to the ChannelInterface (so v3 implements it, v2 doesn't have to).
  • packages/parser/src/models/v3/channel.ts: Implemented title() returning this._json.title.
  • packages/parser/test/models/v3/channel.spec.ts: Two tests — one verifies the value, one verifies undefined when unset.

3 files changed, 19 insertions. Follows the existing minimal pattern used by address().

q404365631 avatar Jun 03 '26 16:06 q404365631

🦋 Changeset detected

Latest commit: c52dff7a1b1d8c48c32402d277d1abe41a6a78df

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@asyncapi/parser Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Jun 03 '26 16:06 changeset-bot[bot]

the underline issue is part of microgrant program. please read the program guidlines https://github.com/asyncapi/community/blob/master/docs/010-contribution-guidelines/microgrant-program.md. thanks

princerajpoot20 avatar Jul 12 '26 07:07 princerajpoot20