Redocly / Redocly/redocly-cli

optional ignore list for no-unresolved-refs rule

Open
#1,275 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

governance question 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.

We use the lint command for OpenAPI descriptions throughout separate phases of the design lifecycle.

  • during schema authoring
  • bundling descriptions
  • in our build

We've run into a scenario where we have certain schemas generated during the build which are documented during the design phase. The linter is flagging these references as unresolved, correctly.

Describe the solution you'd like

I'd like the ability to pass an array of patterns or strings to be matched to the ref uri string to ignore in this particular rule. I can't completely turn the rule off because we only use $ref in our descriptions. no in-line schemas are allowed except for very particular exceptions.

Something like no-http-verbs-in-paths optional validation would work great.

rules:
  no-unresolved-refs: 
    severity: warn
    ignored:
      - meta

Describe alternatives you've considered

I've considered duplicating the rule as a custom rule to insert this logic

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 lint command and the no-unresolved-refs rule configuration. Trace how rule options are parsed and how $ref URI strings are checked; done means patterns such as meta can suppress matching unresolved references while other unresolved references still produce warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.