Skip to content

feat: add reference property to context.report() for external docs links#2734

Open
mvanhorn wants to merge 2 commits intoRedocly:mainfrom
mvanhorn:feat/1052-report-reference
Open

feat: add reference property to context.report() for external docs links#2734
mvanhorn wants to merge 2 commits intoRedocly:mainfrom
mvanhorn:feat/1052-report-reference

Conversation

@mvanhorn
Copy link
Copy Markdown
Contributor

Summary

Adds a reference property to context.report() so custom rules can link to external documentation explaining the design decision behind a rule.

Usage

report({
  message: 'Operation must include a request body',
  reference: 'https://wiki.example.com/api-guidelines#request-bodies',
});

Output (stylish format):

Operation must include a request body

Reference: https://wiki.example.com/api-guidelines#request-bodies

Changes

  • packages/core/src/walk.ts: Added reference?: string to Problem and NormalizedProblem types
  • packages/core/src/format/format.ts: Display reference URL in both stylish and GitHub Actions output formatters

The property passes through automatically via the ...opts spread in the normalization logic, so no additional wiring is needed.

Fixes #1052

This contribution was developed with AI assistance (Claude Code).

@mvanhorn mvanhorn requested a review from a team as a code owner April 10, 2026 09:09
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 10, 2026

⚠️ No Changeset found

Latest commit: 590886e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@tatomyr
Copy link
Copy Markdown
Collaborator

tatomyr commented Apr 10, 2026

Could you add a E2E or a unit test that demonstrates how the output will look like? And please do not modify our PR template.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

context.report(): add new property for external documentation

2 participants