From bc83618f32156262ce8de74f1cb18ac8feed9a6a Mon Sep 17 00:00:00 2001 From: Fran Mendez Date: Mon, 6 Nov 2023 11:44:24 +0100 Subject: [PATCH] feat: remove messageId when converting to 3.0.0 --- src/third-version.ts | 1 + test/output/3.0.0/from-2.6.0-with-deep-local-references.yml | 2 -- .../3.0.0/from-2.6.0-with-servers-and-channels-components.yml | 1 - test/output/3.0.0/from-2.6.0.yml | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/third-version.ts b/src/third-version.ts index 406cdb21..b5d91153 100644 --- a/src/third-version.ts +++ b/src/third-version.ts @@ -325,6 +325,7 @@ function convertMessages(data: ConvertMessagesObjectData): Record{ const messages = {...data.messages}; // Convert schema formats to union schemas Object.entries(messages).forEach(([_, message]) => { + delete message.messageId; if(message.schemaFormat !== undefined) { const payloadSchema = message.payload; message.payload = { diff --git a/test/output/3.0.0/from-2.6.0-with-deep-local-references.yml b/test/output/3.0.0/from-2.6.0-with-deep-local-references.yml index aac96226..c01b937a 100644 --- a/test/output/3.0.0/from-2.6.0-with-deep-local-references.yml +++ b/test/output/3.0.0/from-2.6.0-with-deep-local-references.yml @@ -23,7 +23,6 @@ channels: subscribe.message.0: $ref: '#/components/messages/turnOnOff' customMessageId: - messageId: customMessageId payload: type: object properties: @@ -61,7 +60,6 @@ components: subscribe.message.0: $ref: '#/components/messages/turnOnOff' customMessageId: - messageId: customMessageId payload: type: object properties: diff --git a/test/output/3.0.0/from-2.6.0-with-servers-and-channels-components.yml b/test/output/3.0.0/from-2.6.0-with-servers-and-channels-components.yml index 5401a259..622eca88 100644 --- a/test/output/3.0.0/from-2.6.0-with-servers-and-channels-components.yml +++ b/test/output/3.0.0/from-2.6.0-with-servers-and-channels-components.yml @@ -94,7 +94,6 @@ components: subscribe.message.0: $ref: '#/components/messages/turnOnOff' customMessageId: - messageId: customMessageId payload: type: object subscribe.message.2: diff --git a/test/output/3.0.0/from-2.6.0.yml b/test/output/3.0.0/from-2.6.0.yml index 93cdabbb..3c97a876 100644 --- a/test/output/3.0.0/from-2.6.0.yml +++ b/test/output/3.0.0/from-2.6.0.yml @@ -96,7 +96,6 @@ channels: subscribe.message.0: $ref: '#/components/messages/turnOnOff' customMessageId: - messageId: customMessageId payload: type: object subscribe.message.2: