fix: expose server summary() on ServerInterface for v3 documents#1199
Conversation
|
Co-authored-by: Cursor <cursoragent@cursor.com>
princerajpoot20
left a comment
There was a problem hiding this comment.
@AayushSaini101 the PR has merge conflict. can you have a look at it
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Done fixed thanks |



Summary
Fixes #1076 by exposing
server.summary()andserver.hasSummary()on theshared
ServerInterface, with v3 test coverage.Problem
AsyncAPI v3 defines an optional
summaryfield on the Server Object, and thev3
Servermodel already reads it viaCoreModel. However,ServerInterfacedid not include
summary(), so TypeScript users accessing servers throughdocument.allServers()did not get proper type support for this method.Why only
ServerInterfaceneeded to changeNo changes to the v3
Serverclass were required because:ServerextendsCoreModel, which already implementshasSummary()andsummary()ServerInterface)Why v2 was not changed
summary(onlydescription,url,protocol, etc.)summarySummaryMixinInterfacewould force stub methods on v2ServerPartial<SummaryMixinInterface>was used so:summary()as expectedpackages/parser/src/models/server.tsneeded a production code changeChanges
server.ts: extendServerInterfacewithPartial<SummaryMixinInterface>server.spec.ts(v3): unit tests for.summary()and absent summaryasyncapi.spec.ts(v3): testallServers()exposessummaryparse.spec.ts: integration test for v3allServers().summary()Test plan
allServers()test passesparse()integration test passes