Skip to content

fix: isAsyncAPIDocument not recognizing correct documents - #861

Merged
asyncapi-bot merged 3 commits into
asyncapi:next-major-specfrom
jonaslagoni:fix_isAsyncAPIDocument
Oct 3, 2023
Merged

asyncapi-bot merged 3 commits into
asyncapi:next-major-specfrom
jonaslagoni:fix_isAsyncAPIDocument

Conversation

@jonaslagoni

Copy link
Copy Markdown
Member

Description
This PR fixes a problem where isAsyncAPIDocument cannot recognize parsed documents which means a lot of support functions are not working correctly.

Comment thread src/models/asyncapi.ts Outdated

// https://github.com/asyncapi/parser-api/releases/tag/v2.0.0
export const ParserAPIVersion = '2.0.0';
export const ParserAPIVersion = '2';

@smoya smoya Oct 2, 2023 •

Copy link
Copy Markdown
Member

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

@smoya smoya Oct 2, 2023 •

Copy link
Copy Markdown
Member

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)

Copy link
Copy Markdown
Member Author

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 🤔

Copy link
Copy Markdown
Member Author

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?

@sonarqubecloud

sonarqubecloud Bot commented Oct 3, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@smoya smoya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀🌔

@jonaslagoni

Copy link
Copy Markdown
Member Author

/rtm

@asyncapi-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.0.0-next-major-spec.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@smoya
smoya deleted the fix_isAsyncAPIDocument branch October 5, 2023 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants