Asyncapi 3 Tags Alphabetical

asyncapi-3-tags-alphabetical · built-in

info experience: consistencyexperience: discoverability spec: info

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