feat: add spec-ref-targets rule#2958
Open
vadyvas wants to merge 2 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: 3ecbfe3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contributor
Performance Benchmark (Lower is Faster)
|
Contributor
Author
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3ecbfe3. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why/How?
Added a new built-in rule
spec-ref-targets(AsyncAPI 3 only) that validates the$reftargets the specification restricts:channelmust reference a channel from the rootchannelsobject;messagesmust reference messages of the referenced channel;serversmust reference servers from the rootserversobject.Why. These are MUST/MUST NOT requirements of the AsyncAPI 3 specification (Operation Object, Operation Reply Object, Channel Object). A document that violates them still resolves every
$ref, solintused to accept documents that AsyncAPI tooling and renderers rejectReference
Testing
Screenshots (optional)
Check yourself
Security
Note
Low Risk
Additive lint rule and config/docs updates only; no runtime or security-sensitive paths changed.
Overview
Adds the built-in AsyncAPI 3 rule
spec-ref-targets, which flags internal$refs that violate AsyncAPI 3.0 placement rules (rootoperations/channelsonly, with matching channel message paths and rootserverson channels).The rule is wired into
recommended(warn),recommended-strict/all/spec(error), andminimal(off), with docs, sidebar, changeset, unit tests, and an e2e lint fixture.Reviewed by Cursor Bugbot for commit 3ecbfe3. Bugbot is set up for automated code reviews on this repo. Configure here.