From ebf856edf9207edd47fe9318d2cb44f4eea25fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Ciu=C5=82a?= <35226723+kamil1094@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:28:52 +0100 Subject: [PATCH] fix: update operationMessagesUnambiguity rule validity check (#1038) --- .../src/ruleset/v3/functions/operationMessagesUnambiguity.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/parser/src/ruleset/v3/functions/operationMessagesUnambiguity.ts b/packages/parser/src/ruleset/v3/functions/operationMessagesUnambiguity.ts index 75c1d5206..6f09aec92 100644 --- a/packages/parser/src/ruleset/v3/functions/operationMessagesUnambiguity.ts +++ b/packages/parser/src/ruleset/v3/functions/operationMessagesUnambiguity.ts @@ -31,7 +31,7 @@ export const operationMessagesUnambiguity = createRulesetFunction<{ channel?: {' const channelPointer = targetVal.channel?.$ref as string; // required targetVal.messages?.forEach((message, index) => { - if (!message.$ref.startsWith(`${channelPointer}/messages`)) { + if (message.$ref && !message.$ref.startsWith(`${channelPointer}/messages`)) { results.push({ message: 'Operation message does not belong to the specified channel.', path: [...ctx.path, 'messages', index],