Asyncapi Message MessageId Uniqueness
asyncapi-message-messageId-uniqueness · built-in
info
experience: consistencyexperience: namingexperience: reliability
spec: document
"messageId" must be unique across all the messages.
“messageId” must be unique across all the messages.
Rule definition
The full Spotlight rule — drop it into a ruleset (.spotlight.yaml / .spectral.yaml) and run it with any Spotlight tool.
asyncapi-message-messageId-uniqueness:
title: Asyncapi Message MessageId Uniqueness
reference: https://spotlight-rules.com/spec/rules/asyncapi/asyncapi-message-messageId-uniqueness/
description: '"messageId" must be unique across all the messages.'
message: '"messageId" must be unique across all the messages.'
severity: info
given: $
then:
function: asyncApi2MessageIdUniqueness
tags:
- format:asyncapi
- spec:document
- experience:consistency
- experience:naming
- experience:reliability
prompt: "You are editing an AsyncAPI document to satisfy the Spotlight API
governance rule 'asyncapi-message-messageId-uniqueness' (Asyncapi Message
MessageId Uniqueness). Requirement: \"messageId\" must be unique across all
the messages. 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-message-messageId-uniqueness' (Asyncapi Message MessageId Uniqueness). Requirement: "messageId" must be unique across all the messages. 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) | $ |
| Severity | info — educational by default; raise to warn/error to enforce |
| Reference | https://spotlight-rules.com/spec/rules/asyncapi/asyncapi-message-messageId-uniqueness/ |