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

feat: add isOldAsyncAPIDocument helper #687

Merged
merged 3 commits into from
Dec 13, 2022

Conversation

magicmatatjahu
Copy link
Member

Description

  • add x-parser-api-version to have info about parser-api used in AsyncAPI model
  • isOldAsyncAPIDocument helper function to check if document use old api
  • improve isAsyncAPIDocument
  • add unit tests

cc @jonaslagoni as you want :)

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

Do you want to add a converter as well? I.e. from old parser document to new version? The code you send works:

        // Is from old parser
        const parsedJSON = input.json();
        const detailed = createDetailedAsyncAPI(parsedJSON, parsedJSON);
        doc = createAsyncAPIDocument(detailed);

@derberg
Copy link
Member

derberg commented Dec 8, 2022

one cent from me, please update readme where we document all custom parser extensions

@magicmatatjahu
Copy link
Member Author

@jonaslagoni I can add but it won't work in 100% cases.

@sonarcloud
Copy link

sonarcloud bot commented Dec 9, 2022

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

@magicmatatjahu
Copy link
Member Author

@jonaslagoni Done
@derberg Done

Could you check again?

Copy link
Member

@jonaslagoni jonaslagoni left a comment

Choose a reason for hiding this comment

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

Just one comment, but other then that it LGTM 👍

src/document.ts Show resolved Hide resolved
@magicmatatjahu
Copy link
Member Author

/rtm

@asyncapi-bot asyncapi-bot merged commit ef6f1f5 into asyncapi:next-major Dec 13, 2022
@magicmatatjahu magicmatatjahu deleted the next/is-document branch December 13, 2022 11:21
@asyncapi-bot
Copy link
Contributor

🎉 This PR is included in version 2.0.0-next-major.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

4 participants