Skip to content

Conversation

@Kartikayy007
Copy link
Contributor

@Kartikayy007 Kartikayy007 commented Nov 19, 2025

Description

  • Adds a --ruleset flag to the validate command to support custom Spectral rulesets
  • Supports JavaScript ruleset files (.js, .mjs, .cjs)
  • Keeps the existing default AsyncAPI/Spectral validation behavior unchanged when --ruleset is not provided
  • Allows teams to enforce organization-specific validation rules on AsyncAPI documents
  • Clear error messages for unsupported file types and missing files

Related issue(s)

Resolves #1900
Part of #1785

Test plan

  • Unit tests for custom ruleset validation (test/unit/services/validation.service.test.ts)
    • Custom JS ruleset loading and validation
    • Non-existent ruleset file error handling
  • Manual testing with custom rulesets
  • asyncapi validate --help shows the --ruleset flag

screenshot

Screenshot 2025-11-26 at 4 45 21 AM

@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2025

🦋 Changeset detected

Latest commit: 5b120e1

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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 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 --ruleset flag for custom Spectral rules

- 5872e92: feat: add --ruleset flag for custom Spectral rules
- 97ec751: fixed the sonar issue

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:.

@Kartikayy007 Kartikayy007 marked this pull request as draft November 25, 2025 20:49
@Kartikayy007 Kartikayy007 marked this pull request as ready for review November 25, 2025 23:16
@sonarqubecloud
Copy link

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.

feat: add --ruleset flag for custom Spectral rules

3 participants