Asyncapi Tags Alphabetical

asyncapi-tags-alphabetical · built-in

info experience: consistencyexperience: discoverability spec: document

AsyncAPI object must have alphabetical "tags".

AsyncAPI object must have alphabetical “tags”.

Rule definition

The full Spotlight rule — drop it into a ruleset (.spotlight.yaml / .spectral.yaml) and run it with any Spotlight tool.

asyncapi-tags-alphabetical:
  title: Asyncapi Tags Alphabetical
  reference: https://spotlight-rules.com/spec/rules/asyncapi/asyncapi-tags-alphabetical/
  description: AsyncAPI object must have alphabetical "tags".
  message: AsyncAPI object must have alphabetical "tags".
  severity: info
  given: $
  then:
    field: tags
    function: alphabetical
    functionOptions:
      keyedBy: name
  tags:
    - format:asyncapi
    - spec:document
    - experience:consistency
    - experience:discoverability
  prompt: "You are editing an AsyncAPI document to satisfy the Spotlight API
    governance rule 'asyncapi-tags-alphabetical' (Asyncapi Tags Alphabetical).
    Requirement: AsyncAPI object must have alphabetical \"tags\". To fix: Sort
    the entries by `name` into ascending alphabetical order. 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-tags-alphabetical' (Asyncapi Tags Alphabetical). Requirement: AsyncAPI object must have alphabetical "tags". To fix: Sort the entries by `name` into ascending alphabetical order. 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.
ArtifactAsyncAPI
Applies at (given)$
Severityinfo — educational by default; raise to warn/error to enforce
Referencehttps://spotlight-rules.com/spec/rules/asyncapi/asyncapi-tags-alphabetical/