-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add check that $ref
value is a string
(#92)
#94
fix: add check that $ref
value is a string
(#92)
#94
Conversation
Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
Co-authored-by: Maciej Urbańczyk <urbanczyk.maciej.95@gmail.com>
8fab690
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aeworxet can you update description and point to related Slack discussion?
also, if test description refers to error throwing, shouldn't tests do also not.toThrowError()
?
e42cf8d
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 |
🎉 This PR is included in version 0.3.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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 #92).