Closed aeworxet closed 2 years ago
You should add some simple test with AsyncAPI document with defined some messages with
$ref
and without it in.channels.X.publish/subcribe.message
and only check if main function throws or not error, ok? :)
I checked this, and bundler just ignores it and resolves it normally, that is fetches the references and replaces them with the original values. Only $refs
under $.channels.*.*.message
will be fetched and resolved under #components/messages
@Souvikns or @derberg Could you make review? I cannot accept 😅
Changed tests to logic, that if async function resolved Promise, then it did not throw. All other variants were not acceptable for different reasons. One was even crashing Jest itself.
@derberg Updated PR's description to point to related Slack discussion.
/rtm
:tada: This PR is included in version 0.3.7 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
This PR adds to function
isExternalReference()
additional check if$ref
's value passed to it has the type ofstring
(adds type guard for JS version, to which TS code will be transpiled when NPM package is released).Except general usefulness, it is also a possible indirect fix of an issue reported by user in https://asyncapi.slack.com/archives/CQVJXFNQL/p1666700935030749 (excerpt from the conversation is mirrored in repository's issue https://github.com/asyncapi/bundler/issues/92).