spectral:oas warn on by default

oas3-unused-component

Applies to
components
Selects
$
Function
oasUnusedComponent
Specs
OpenAPI 3.0OpenAPI 3.1OpenAPI 3.2
Message
Potentially unused component has been detected.

Use it

This rule ships with OpenLint in spectral:oas. Extending the ruleset turns it on:

extends: spectral:oas
rules:
  oas3-unused-component: warn   # or off, or another severity

Definition

As defined in @openlint/openlint-rulesets. Functions show by name.

oas3-unused-component:
  message: Potentially unused component has been detected.
  recommended: true
  formats:
    - OpenAPI 3.x
  given: $
  resolved: false
  then:
    function: oasUnusedComponent

About this rule

Potential unused reusable components entry has been detected.

Warning

This rule may identify false positives when linting a specification that acts as a library (a container storing reusable objects, leveraged by other specifications that reference those objects).

Sources