Info Asyncapi Version Semver

info-asyncapi-version-semver

info experience: versioning spec: info

AsyncAPI version should be semantic.

info.version should be semantic (e.g. 1.0.0).

Rule definition

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

info-asyncapi-version-semver:
  title: Info Asyncapi Version Semver
  reference: https://spotlight-rules.com/spec/rules/asyncapi/info-asyncapi-version-semver/
  description: info.version should be semantic (e.g. 1.0.0).
  message: AsyncAPI version should be semantic.
  given: $.info.version
  severity: info
  then:
    function: pattern
    functionOptions:
      match: ^\d+\.\d+\.\d+
  tags:
    - format:asyncapi
    - spec:info
    - experience:versioning
  prompt: "You are editing an AsyncAPI document to satisfy the Spotlight API
    governance rule 'info-asyncapi-version-semver' (Info Asyncapi Version
    Semver). Requirement: info.version should be semantic (e.g. 1.0.0). To fix:
    Ensure the targeted value matches the regular expression
    `^\\d+\\.\\d+\\.\\d+`; rewrite any value that does not. This rule is
    evaluated at the JSONPath `$.info.version` — 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 'info-asyncapi-version-semver' (Info Asyncapi Version Semver). Requirement: info.version should be semantic (e.g. 1.0.0). To fix: Ensure the targeted value matches the regular expression `^\d+\.\d+\.\d+`; rewrite any value that does not. This rule is evaluated at the JSONPath `$.info.version` — 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.version
Severityinfo — educational by default; raise to warn/error to enforce
Referencehttps://spotlight-rules.com/spec/rules/asyncapi/info-asyncapi-version-semver/