redocly-cli icon indicating copy to clipboard operation
redocly-cli copied to clipboard

Spectral rule equivalents

Open lornajane opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.

Users with existing Spectral rulesets want to migrate to Redocly, not all rules have a built-in equivalent

Describe the solution you'd like

A list of substitutions to try. Here's a starter set, these need to be tested and added to our docs. Additions, comments and feedback all gratefully received!

I wonder if it would be helpful to include configurable rule equivalents, like:

rules:
  rule/info-description:
    subject:
      type: Info
      property: description
    assertions:
      defined: true

no-eval:

rules:
  rule/no-eval:
    subject:
      type: any
      property: description
    assertions:
      notPattern: 'eval('

no-script

rules:
  rule/no-script-tag:
    subject:
      type: any
      property: description
    assertions:
      notPattern: '<script'

openapi-tags:

rules:
  rule/openapi-tags:
    subject:
      type: Tag # or maybe TagList ?
    assertions:
      defined: true

operation-tags:

rules:
  rule/operation-tags:
    subject:
      type: Operation
      property: tags
    assertions:
      defined: true
      maxLength: 1 # I guess we already have `operation-singular-tag`

(credit to @adamaltman for the list!)

Describe alternatives you've considered

Additional context

lornajane avatar Jul 18 '23 10:07 lornajane

Maybe add to the cookbook?

adamaltman avatar Nov 11 '23 14:11 adamaltman