This rule belongs to the
openapi-v3-apimatic-linting ruleset and states that:
A component that is defined globally using the 'components' root object property must be referenced at least once by any other object in the API specification document. Referencing is performed using $ref.
|Message||Component was defined but never used.|
|Broad Category||OpenAPI Components|
|Products Impacted||API Transformer, Code Generation, Developer Experience Portal|
- Ensure that each globally defined component is referenced at least once in the API.
- A component can be referenced using $ref with a valid path that can begin with '#/components/'.
- If a schema 'Pet' is defined under #/components/schemas, there must exist an object in the document that references this schema using a path like #/components/schemas/Pet.
- The components section helps define reusable components. If a component definition is not expected to be used, it must be removed.