Skip to content

fix(validate): only suppress warning rules in --suppressAllWarnings - #2341

Open
hoanle0126 wants to merge 1 commit into
asyncapi:masterfrom
hoanle0126:fix/validate-suppress-all-warnings-2340
Open

hoanle0126 wants to merge 1 commit into
asyncapi:masterfrom
hoanle0126:fix/validate-suppress-all-warnings-2340

Conversation

@hoanle0126

Copy link
Copy Markdown

Description

  • Filters diagnostics by d.severity === DiagnosticSeverity.Warning in ValidationService.buildParserWithAllWarningsSuppressed (src/domains/services/validation.service.ts) so --suppressAllWarnings no longer disables error, information, or hint rules (preventing schema-invalid specifications from passing validation with exit code 0).
  • Delegates to buildParserWithSpecificWarningsSuppressed so non-extendable diagnostic codes (such as invalid-ref) never throw Cannot extend non-existing rule.
  • Adds unit and integration tests in test/unit/services/validation.service.test.ts and test/integration/validate.test.ts, plus a patch changeset.

Related issue(s)

Resolves #2340

@changeset-bot

changeset-bot Bot commented Nov 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6f122a0

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 Patch

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

@sonarqubecloud

sonarqubecloud Bot commented Nov 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

[BUG] validate --suppressAllWarnings disables Error rules (passing invalid specs) and crashes on invalid-ref

1 participant