Asyncapi Unused Components Server
asyncapi-unused-components-server · built-in
info
experience: consistencyexperience: reliability
spec: serversspec: components
Potentially unused components server has been detected.
Potentially unused components server has been detected.
Rule definition
The full Spotlight rule — drop it into a ruleset (.spotlight.yaml / .spectral.yaml) and run it with any Spotlight tool.
asyncapi-unused-components-server:
title: Asyncapi Unused Components Server
reference: https://spotlight-rules.com/spec/rules/asyncapi/asyncapi-unused-components-server/
description: Potentially unused components server has been detected.
message: Potentially unused components server has been detected.
severity: info
given: $.components.servers
then:
function: unreferencedReusableObject
functionOptions:
reusableObjectsLocation: "#/components/servers"
tags:
- format:asyncapi
- spec:servers
- spec:components
- experience:consistency
- experience:reliability
prompt: "You are editing an AsyncAPI document to satisfy the Spotlight API
governance rule 'asyncapi-unused-components-server' (Asyncapi Unused
Components Server). Requirement: Potentially unused components server has
been detected. To fix: Remove the unreferenced reusable object, or reference
it where it is needed. This rule is evaluated at the JSONPath
`$.components.servers` — inspect every location it matches and correct only
what violates the rule. Make the smallest change that satisfies the rule,
leave all unrelated content, key order, comments, and formatting unchanged,
and keep the document valid AsyncAPI. Return only the complete corrected
document, with no commentary."
AI fix prompt — send this to Claude, Gemini, or ChatGPT with your artifact to auto-fix this rule
You are editing an AsyncAPI document to satisfy the Spotlight API governance rule 'asyncapi-unused-components-server' (Asyncapi Unused Components Server). Requirement: Potentially unused components server has been detected. To fix: Remove the unreferenced reusable object, or reference it where it is needed. This rule is evaluated at the JSONPath `$.components.servers` — inspect every location it matches and correct only what violates the rule. Make the smallest change that satisfies the rule, leave all unrelated content, key order, comments, and formatting unchanged, and keep the document valid AsyncAPI. Return only the complete corrected document, with no commentary.
| Artifact | AsyncAPI |
|---|---|
| Applies at (given) | $.components.servers |
| Severity | info — educational by default; raise to warn/error to enforce |
| Reference | https://spotlight-rules.com/spec/rules/asyncapi/asyncapi-unused-components-server/ |