-
-
Notifications
You must be signed in to change notification settings - Fork 98
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: isAsyncAPIDocument not recognizing correct documents #861
fix: isAsyncAPIDocument not recognizing correct documents #861
Conversation
src/models/asyncapi.ts
Outdated
@@ -12,7 +12,7 @@ import type { ServersInterface } from './servers'; | |||
import type { v2, v3 } from '../spec-types'; | |||
|
|||
// https://github.com/asyncapi/parser-api/releases/tag/v2.0.0 | |||
export const ParserAPIVersion = '2.0.0'; | |||
export const ParserAPIVersion = '2'; |
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.
Why changing this back to the major? Having that granularity of a full semver, we will always know which parser-api version was supported when parsing.
If you want to compare by major, you can ParserAPIVersion.split('.')[0]
, as in https://github.com/smoya/multi-parser-js/blob/main/src/utils.ts
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.
Thinking deeply, I'm not sure if has a useful use case. Even for debugging, knowing the version of the Parser-JS is more than enough.
If you don't see one use case either (as I guess), we should also change the multi-parser-js library (I'm more than happy to accept a PR)
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.
I dont imidiately see a reason to have the full number there, also that would mean we would need to change it for each change we do, not really maintainable 🤔
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.
The multi parser implementation would still work right?
Kudos, SonarCloud Quality Gate passed! |
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.
LGTM! 🚀🌔
/rtm |
🎉 This PR is included in version 3.0.0-next-major-spec.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This PR fixes a problem where
isAsyncAPIDocument
cannot recognize parsed documents which means a lot of support functions are not working correctly.