Skip to content

feat: add support for the strategy parameter in component-name-unique rule - #3011

Open
harshit078 wants to merge 8 commits into
Redocly:mainfrom
harshit078:feat-support-for-strategy-parameter
Open

feat: add support for the strategy parameter in component-name-unique rule#3011
harshit078 wants to merge 8 commits into
Redocly:mainfrom
harshit078:feat-support-for-strategy-parameter

Conversation

@harshit078

@harshit078 harshit078 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What/Why/How?

#2898

Reference

Testing

Screenshots (optional)

Check yourself

  • This PR follows the contributing guide
  • All new/updated code is covered by tests
  • Core code changed? - Tested with other Redocly products (internal contributions only)
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update has been considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

Note

Low Risk
Lint and bundle naming alignment with shared utility; behavior is covered by new tests and defaults preserve existing basename behavior.

Overview
Adds a strategy option (basename | title, default basename) to the component-name-unique lint rule so uniqueness checks mirror bundle --component-names-strategy.

With title, externally referenced schemas are keyed by PascalCase-sanitized title (same as bundling); same basename with different titles no longer collide, while identical titles across files still fail. Schemas without title fall back to basename/file naming; root components/schemas keys are unchanged.

componentNameFromTitle is shared between bundle-visitor and the rule (replacing inline logic in the visitor). Docs for bundle and component-name-unique cross-link the matching settings.

Reviewed by Cursor Bugbot for commit 12f8387. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 12f8387

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

This PR includes changesets to release 4 packages
Name Type
@redocly/cli Minor
@redocly/respect-core Minor
@redocly/openapi-core Minor
@redocly/client-generator 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

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Performance Benchmark (Lower is Faster)

CLI Version Bundle Lint Check Config
cli-latest ▓ 1.01x ± 0.01 ▓ 1.00x (Fastest) ▓ 1.00x (Fastest)
cli-next ▓ 1.00x (Fastest) ▓ 1.00x ± 0.01 ▓ 1.00x ± 0.01

@harshit078
harshit078 marked this pull request as ready for review August 5, 2026 07:52
@harshit078
harshit078 requested review from a team as code owners August 5, 2026 07:52

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8cbffec. Configure here.

Comment thread packages/core/src/rules/oas3/component-name-unique.ts
@adamaltman

Copy link
Copy Markdown
Member

Interesting idea!

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.

2 participants