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 spec 3.0 validation support #747

Merged
merged 12 commits into from
Aug 9, 2023

Conversation

Amzani
Copy link
Collaborator

@Amzani Amzani commented Jul 28, 2023

Fixes #746

  • Updated dependencies
  • Upgraded @asyncapi/specs version from 4.2.1 to 6.0.0-next-major-spec.2 including adapting to breaking changes
  • UI Part is done
  • 2.x.x to 3.0.0 Conversion is working

When editing a V3 Async API document

Screenshot 2023-07-28 at 14 47 58

2.x.x to 3.0.0 Conversion

Screenshot 2023-07-28 at 14 49 00

Still need to figure out

  • The validation is still not working as @smoya is refactoring ParserJS to support schema validation
  • We should add the V3 support as an option in studio setting as it's weird to enable the conversion to 3.0.0 for all users by default as the tooling support of that version is still in progress.
Screenshot 2023-07-28 at 15 17 40

Any ideas folks ?

@changeset-bot
Copy link

changeset-bot bot commented Jul 28, 2023

🦋 Changeset detected

Latest commit: 77f368b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@asyncapi/studio Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Jul 28, 2023

Deploy Preview for modest-rosalind-098b67 ready!

Name Link
🔨 Latest commit 77f368b
🔍 Latest deploy log https://app.netlify.com/sites/modest-rosalind-098b67/deploys/64d38df4120ee80008aee488
😎 Deploy Preview https://deploy-preview-747--modest-rosalind-098b67.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@netlify
Copy link

netlify bot commented Jul 28, 2023

Deploy Preview for asyncapi-studio-design-system ready!

Name Link
🔨 Latest commit 77f368b
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-studio-design-system/deploys/64d38df4904e0800088fe14d
😎 Deploy Preview https://deploy-preview-747--asyncapi-studio-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Amzani Amzani marked this pull request as draft July 28, 2023 13:08
Copy link
Member

@KhudaDad414 KhudaDad414 left a comment

Choose a reason for hiding this comment

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

Have been playing around with changes in this PR and the conversion pop-up behaviour seems odd:

  1. when the support v3 toggle is on, and I am editing a v3 document, and I select new File it goes black to normal settings and v2. I expect it to show me a window if I want to convert the example to v3.
  2. When I am editing a v2 document and I turn the support v3 toggle on, nothing happens. I expect the conversion pop-up to show up.

@Amzani
Copy link
Collaborator Author

Amzani commented Aug 1, 2023

Have been playing around with changes in this PR and the conversion pop-up behaviour seems odd:

  1. when the support v3 toggle is on, and I am editing a v3 document, and I select new File it goes black to normal settings and v2. I expect it to show me a window if I want to convert the example to v3.

@KhudaDad414 what do you mean by "it goes back to normal settings" ? the support V3 in setting is toggled off ?

The normal behaviour of the conversion window that shows during edition is the following :

  • Asked only one time! during edition
  • If you answer no → you need to wait 24h or you have to delete the informed-about-latest in sessionStorage
  1. When I am editing a v2 document and I turn the support v3 toggle on, nothing happens. I expect the conversion pop-up to show up.

Fixed in my last commits

@Amzani Amzani requested a review from KhudaDad414 August 1, 2023 15:29
@Amzani
Copy link
Collaborator Author

Amzani commented Aug 2, 2023

@smoya the validation works with the last Parser-JS update.

Screenshot 2023-08-01 at 17 33 33

IMO it's already useful for doc contributors and can be merged. This is a loom demonstrating how it works:

cc @alequetzalli @derberg @jonaslagoni

@Amzani Amzani marked this pull request as ready for review August 2, 2023 08:43
@smoya
Copy link
Member

smoya commented Aug 2, 2023

@smoya the validation works with the last Parser-JS update.

Clarifying it works because Studio runs an additional JSON Schema validation through the yaml-schema Monaco plugin. validation in parser is still WIP (blocked, see asyncapi/parser-js#825 (comment)).

@smoya
Copy link
Member

smoya commented Aug 2, 2023

@Amzani I love seeing how this is starting to look! 🙌
Do you think it would be possible to show a popup suggesting to enable v3 validation when a document with version 3 is detected?

@Amzani
Copy link
Collaborator Author

Amzani commented Aug 4, 2023

@smoya I think we could just have an other setting to enable/disable the spectral validation of v3 documents.

@Amzani
Copy link
Collaborator Author

Amzani commented Aug 7, 2023

@smoya I've just disabled the governance tab for v3.0.0 for now, we can enable it once asyncapi/parser-js#825 (comment) is fixed.

KhudaDad414
KhudaDad414 previously approved these changes Aug 7, 2023
Copy link
Member

@KhudaDad414 KhudaDad414 left a comment

Choose a reason for hiding this comment

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

LGTM

@sonarcloud
Copy link

sonarcloud bot commented Aug 9, 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 1 Code Smell

No Coverage information No Coverage information
0.1% 0.1% Duplication

@Amzani
Copy link
Collaborator Author

Amzani commented Aug 9, 2023

/rtm

@asyncapi-bot asyncapi-bot merged commit 94215e6 into asyncapi:master Aug 9, 2023
20 checks passed
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.

Studio: Enable Spec 3.0 validation only
4 participants