Redocly / Redocly/redocly-cli

Support per-format configurable rules

Open
#1,725 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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 have a (very cool!) configurable rules feature that also works well for all the different formats we support (OpenAPI, AsyncAPI, Arazzo - of various versions). However, the rules defined in a configuration file apply to all API descriptions of all formats when linting. It would be better to be able to define rules for each API description format/version to avoid having to pre-process, repeat-define rules in per-api configurations, or use multiple config files (these are the existing alternatives as I see them).

Describe the solution you'd like

I would like us to support configurable rules alongside per-format rules configuration (which exists and is under renaming discussion in #1723 ):

oas3_1Rules:
  rule/info-description:
    subject:
      type: Info
      property: description
    assertions:
      defined: true
      minLength: 300

Describe alternatives you've considered

Everyone has to write their rules in plugins, so they can be exported for different types and included in the per-format sections of the config file.

Additional context

From a discussion about support and documentation for linting multiple API description formats in a single project with @DmitryAnansky and @tatomyr .

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

The issue names no files, tests, or entry points. Start by tracing the existing configurable-rules handling and the per-format configuration referenced in #1723; done means rules can be scoped to each format/version without requiring preprocessing, duplicated per-API rules, multiple config files, or plugins.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.