opticdev / optic

OpenAPI linting, diffing and testing. Optic helps prevent breaking changes, publish accurate documentation and improve the design of your APIs.
https://useoptic.com
MIT License
1.36k stars 83 forks source link

Include operations exclusion for spectral ruleset #2615

Closed maticardenas closed 10 months ago

maticardenas commented 10 months ago

Describe the enhancement

We have recently come across scenarios where we would have had found useful to exclude or skip certain operations from the spectral linting rules, and noticed that exclude_operations_with_extension does not work for the spectral ruleset in an optic configuration file.

ruleset:
  - breaking-changes:
      exclude_operations_with_extension: x-internal
  - naming:
      required_on: always
      severity: warn
      properties: snake_case
      pathComponents: param-case
      requestHeaders: Capital-Param-Case
      queryParameters: snake_case
      responseHeaders: param-case
      exclude_operations_with_extension: x-skip-lint
  - examples:
      required_on: always
      severity: warn
      require_request_examples: true
      require_response_examples: true
      require_parameter_examples: true
      exclude_operations_with_extension: x-skip-lint
  - spectral:
      exclude_operations_with_extension: x-skip-lint
      always:
        - .spectral.yml

Therefore the request would be enabling / adding exclude_operations_with_extension functionality for spectral ruleset, the same way it already exists for others.

niclim commented 10 months ago

Hi - this has been included in the 0.53.15 release