Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support per-format configurable rules #1725

Open
lornajane opened this issue Sep 10, 2024 · 2 comments
Open

Support per-format configurable rules #1725

lornajane opened this issue Sep 10, 2024 · 2 comments

Comments

@lornajane
Copy link
Collaborator

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 .

@tatomyr
Copy link
Contributor

tatomyr commented Sep 11, 2024

Currently, all configurable rules are mixed together, even if they are defined under a specific rule section. We have to change the way we group them (probably in groupStyleguideAssertionRules).

@adamaltman
Copy link
Member

I think a unified approach would be better:

#1723 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants