Redocly / Redocly/redocly-cli

Add support for the `strategy` parameter in the `component-name-unique` rule

Open
#2,898 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

p3 Type: Enhancement
Dominant language
TypeScript
Stars
1.5k
Forks
228
Avg merge
1d 14h
Merged PRs (30d)
48

Description

Is your feature request related to a problem? Please describe.
For bundle was added --component-names-strategy flag that allows create components name by title.
component-name-unique rule doesn't know anything about the title strategy.

Describe the solution you'd like
Need to add a strategy option to the settings for component-name-unique rule and add logic that the lint command knows about component-name-unique by title

Example of configuring rule

rules:
  component-name-unique:
    schemas: error
    parameters: off
    responses: warn
    requestBodies: warn
    strategy: basename # or title

Describe alternatives you've considered

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing component-name-unique rule and the bundle --component-names-strategy flag described in PR 2851. Trace how the lint command derives component names, then add support for the rule's strategy setting so basename and title produce consistent results.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.