Describe the bug
Spectral alert oas3-unused-component warning.
To Reproduce
Given this OpenAPI document and referenced document in same folder:
index.yaml
openapi: 3.1.0
info:
title: Test
version: 1.0.0
paths:
'/':
description: test
get:
operationId: test
description: test
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: './common.yaml#/components/schemas/ResponseType'
common.yaml
openapi: 3.1.0
info:
title: Common schema definition
description: test
version: 1.0.0
paths: {}
components:
schemas:
# Spectral lint warning "Potentially unused component has been detected."
ResponseType:
type: string
example: test
description: test
Run this CLI command
spectral lint index.yaml common.yaml
See warning
/tmp/test/common.yaml
10:18 warning oas3-unused-component Potentially unused component has been detected. components.schemas.ResponseType
**Expected behavior**
Component ResponseType used in index.yaml. Spectral can't alert oas3-unused-component warning.
Describe the bug Spectral alert oas3-unused-component warning.
To Reproduce
index.yaml
common.yaml
Run this CLI command
See warning
/tmp/test/common.yaml 10:18 warning oas3-unused-component Potentially unused component has been detected. components.schemas.ResponseType