Skip to content

feat: enable validation of AsyncAPI Spec v3 documents in validate command - #780

Merged
asyncapi-bot merged 6 commits into
asyncapi:masterfrom
smoya:feat/supportV3Validation
Sep 14, 2023
Merged

asyncapi-bot merged 6 commits into
asyncapi:masterfrom
smoya:feat/supportV3Validation

Conversation

@smoya

@smoya smoya commented Aug 31, 2023 •

Copy link
Copy Markdown
Member

Description

Fixes #770

This PR enables validation of AsyncAPI v3 documents through the validate command.
In order to not break model generation (that uses the future version of Parser-JS v3, which breaks the API), It uses a new independent library (https://github.com/smoya/multi-parser-js) that is temporarily needed for "downgrading" the parsed document to previous Parser-API version (v1.0.0) so it's aligned with the one in use by Modelina parser version. It is needed until asyncapi/modelina#1493 gets fixed

Related issue(s)
#770

cc @jonaslagoni

Comment thread package.json Outdated

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.

This lib can eventually go into AsyncAPI org, it is just a matter of starting the "donation" process.

Comment thread package.json Outdated

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.

We have two options as far as I can see here:

  1. Hold this PR until the Parser-JS v3 version gets released, then upgrade to that version and merge.
  2. As Studio did already, work with the pre-release version.

I vote for the second option (as Studio did) so we can enable that ASAP, give value to the users who might want to play with Spec v3 now and also help us finding possible bugs in our tooling.

Owners should decide here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd go for the second option too 👍

Comment thread test/commands/validate.test.ts Resolved
Comment thread test/valid-specification-latest.yml Resolved
@smoya
smoya force-pushed the feat/supportV3Validation branch from c6e5aea to 8bd990e Compare September 12, 2023 10:00
@smoya
smoya requested review from Shurtu-gal and fmvilas September 12, 2023 10:00
@smoya
smoya force-pushed the feat/supportV3Validation branch from 8bd990e to 0527ff0 Compare September 12, 2023 10:08
@smoya

smoya commented Sep 12, 2023

Copy link
Copy Markdown
Member Author

@Shurtu-gal I fixed the tests location.

@Shurtu-gal Shurtu-gal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Test folder LGTM 🚀

Souvikns
Souvikns previously approved these changes Sep 13, 2023
Comment thread test.asyncapi-cli Outdated
@@ -0,0 +1 @@
{"store":{}} No newline at end of file

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.

Is this needed @Souvikns ?

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.

I think we can add it to the gitignore

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.

Done!

@sonarqubecloud

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
0.0% 0.0% Duplication

@smoya

smoya commented Sep 14, 2023

Copy link
Copy Markdown
Member Author

/rtm

@asyncapi-bot
asyncapi-bot merged commit 9590650 into asyncapi:master Sep 14, 2023
@smoya
smoya deleted the feat/supportV3Validation branch September 14, 2023 09:51
@asyncapi-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.56.0 🎉

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.

CLI: validate command should validate AsyncAPI Spec v3 documents

5 participants