Skip to content
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

Merged

Conversation

jonaslagoni
Copy link
Member

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

@@ -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';
Copy link
Member

@smoya smoya Oct 2, 2023

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

Copy link
Member

@smoya smoya Oct 2, 2023

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
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
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
Copy link

sonarqubecloud bot commented Oct 3, 2023

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

Copy link
Member

@smoya smoya left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀🌔

@jonaslagoni
Copy link
Member Author

/rtm

@asyncapi-bot asyncapi-bot merged commit b5684de into asyncapi:next-major-spec Oct 3, 2023
11 checks passed
@asyncapi-bot
Copy link
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