feat(parser): add title() method to v3 Channel model
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 optionaltitle?(): string | undefinedto theChannelInterface(so v3 implements it, v2 doesn't have to).packages/parser/src/models/v3/channel.ts: Implementedtitle()returningthis._json.title.packages/parser/test/models/v3/channel.spec.ts: Two tests — one verifies the value, one verifiesundefinedwhen unset.
3 files changed, 19 insertions. Follows the existing minimal pattern used by address().
🦋 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
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
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