Skip to content

feat: add new feature to supress the warnings #1805

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

Merged
merged 11 commits into from
Jun 21, 2025

Conversation

AayushSaini101
Copy link
Collaborator

@AayushSaini101 AayushSaini101 commented Jun 16, 2025

Resolves: #1564

  • Add a new flag to the validate command, --suppressWarnings, which is used to suppress warnings in the asyncapi document during validation, and --supressAllWarnings to remove all warnings
  • The documentation has been updated with proper usage.
  • New test cases has been added to verify the changes

Copy link

changeset-bot bot commented Jun 16, 2025

🦋 Changeset detected

Latest commit: e0c358d

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

This PR includes changesets to release 1 package
Name Type
@asyncapi/cli 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

Copy link
Contributor

github-actions bot commented Jun 16, 2025

Changeset has been generated for this PR as part of auto-changeset workflow.

Please review the changeset before merging the PR.
---
'@asyncapi/cli': minor
---

feat: add new feature to supress the warnings

- ab94c15: Add a new flag that is --x-suppress-warnings to supress the warning in the validate command
- 55819cd: Allow to pass multiple warnings to supress and add check to verify the warning is correct or not
- 885fc71: Update src/core/parser.ts

Co-authored-by: Souvik De <souvikde.ns@gmail.com>
- 16b22de: Update src/core/flags/validate.flags.ts

Co-authored-by: Souvik De <souvikde.ns@gmail.com>
- de1caad: Add another flag to supressallwarnings and update test case

If you are a maintainer or the author of the PR, you can change the changeset by clicking here

Tip

If you don't want auto-changeset to run on this PR, you can add the label skip-changeset to the PR or remove the changeset and change PR title to something other than fix: or feat:.

asyncapi-bot pushed a commit to AayushSaini101/cli that referenced this pull request Jun 16, 2025
@AayushSaini101
Copy link
Collaborator Author

/u

Copy link

asyncapi-bot pushed a commit to AayushSaini101/cli that referenced this pull request Jun 16, 2025
Copy link

asyncapi-bot pushed a commit to AayushSaini101/cli that referenced this pull request Jun 16, 2025
asyncapi-bot pushed a commit to AayushSaini101/cli that referenced this pull request Jun 16, 2025
@AayushSaini101
Copy link
Collaborator Author

/u

@AayushSaini101 AayushSaini101 changed the title feat: add new flag for the supress warning feat: add new feature to supress the warnings Jun 16, 2025
asyncapi-bot pushed a commit to AayushSaini101/cli that referenced this pull request Jun 17, 2025
asyncapi-bot pushed a commit to AayushSaini101/cli that referenced this pull request Jun 17, 2025
asyncapi-bot pushed a commit to AayushSaini101/cli that referenced this pull request Jun 17, 2025
Copy link
Member

@Souvikns Souvikns left a comment

Choose a reason for hiding this comment

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

Everything else is fine, but I think it would be nice to have support for reading a file, like ignore file for warnings and errors.

Also how would someone know the ids for the warning, do you have any documentation for that.

@github-project-automation github-project-automation bot moved this from To Triage to Backlog in CLI - Kanban Jun 18, 2025
AayushSaini101 and others added 3 commits June 18, 2025 12:29
Co-authored-by: Souvik De <souvikde.ns@gmail.com>
Co-authored-by: Souvik De <souvikde.ns@gmail.com>
@AayushSaini101
Copy link
Collaborator Author

Everything else is fine, but I think it would be nice to have support for reading a file, like ignore file for warnings and errors.

Also how would someone know the ids for the warning, do you have any documentation for that.

Make sense, we can allow file support as well, but we need to consider only warning statements, because errors must be resolved, and we don't have any documentions for this as well

docs/usage.md Outdated
@@ -815,10 +815,15 @@ FLAGS
--proxyPort=<value> Port number number for the proxyHost.
--score Compute the score of the AsyncAPI document. Scoring is based on whether the
document has description, license, server and/or channels.
--x-suppress-warnings=<value> One or more warning codes to suppress from diagnostics output. Can be passed
Copy link
Member

Choose a reason for hiding this comment

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

What's the reasoning for that x- here? 🤔 Wouldn't it be better to just make it suppress-warnings or no-warnings?

That said, I'd even go further and add no-linting so it removes the warnings and the recommendations but leaves the errors.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, need to remove x- here also thanks for idea regarding the supress all warning, we also dicussed in the recent metting as well with @Shurtu-gal i am current implementing it thanks

Copy link

@AayushSaini101
Copy link
Collaborator Author

SupressingWarnings:
image

SupressingAllWarnings:
image

ifinvalid key is passed:
image

@Shurtu-gal @Souvikns

@AayushSaini101 AayushSaini101 requested a review from Souvikns June 19, 2025 17:16
Copy link
Member

@Souvikns Souvikns left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@AayushSaini101
Copy link
Collaborator Author

/rtm

@asyncapi-bot asyncapi-bot merged commit 0754d1d into asyncapi:master Jun 21, 2025
26 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in CLI - Kanban Jun 21, 2025
AayushSaini101 pushed a commit to AayushSaini101/cli that referenced this pull request Jun 21, 2025
AayushSaini101 pushed a commit to AayushSaini101/cli that referenced this pull request Jun 21, 2025
AayushSaini101 pushed a commit to AayushSaini101/cli that referenced this pull request Jun 21, 2025
AayushSaini101 pushed a commit to AayushSaini101/cli that referenced this pull request Jun 21, 2025
@aeworxet
Copy link
Contributor

@asyncapi/bounty_team

@asyncapi-bot asyncapi-bot added the bounty AsyncAPI Bounty program related label label Jun 23, 2025
@aeworxet aeworxet moved this to Completed in Bounty Program Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty AsyncAPI Bounty program related label ready-to-merge
Projects
Status: Completed
Status: Done
Development

Successfully merging this pull request may close these issues.

[FEATURE] Disable validation checks
6 participants