From 1b9b99d50c8de8d91173c5d06301f6475f03a14d Mon Sep 17 00:00:00 2001 From: Aayush Kumar Sahu Date: Fri, 1 Sep 2023 20:54:06 +0530 Subject: [PATCH] update parser and fix broken tests --- package-lock.json | 14 -------------- test/fixtures/asyncapidiff.fixtures.ts | 16 ++++------------ test/fixtures/diff.fixtures.ts | 20 ++++++++------------ test/fixtures/main.fixtures.ts | 24 ++++++------------------ 4 files changed, 18 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b7fc279..013e36a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4101,20 +4101,6 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", diff --git a/test/fixtures/asyncapidiff.fixtures.ts b/test/fixtures/asyncapidiff.fixtures.ts index 56fe8aae..9a739209 100644 --- a/test/fixtures/asyncapidiff.fixtures.ts +++ b/test/fixtures/asyncapidiff.fixtures.ts @@ -119,10 +119,8 @@ export const MarkdownJSONSubtypeChanges = `## Breaking "type": "object", "x-parser-schema-id": "" }, - "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", "x-parser-message-name": "channelMessage", - "x-parser-message-parsed": true, - "x-parser-original-traits": [ + "traits": [ { "headers": { "properties": { @@ -173,10 +171,8 @@ export const MarkdownJSONSubtypeChanges = `## Breaking "type": "object", "x-parser-schema-id": "" }, - "schemaFormat": "application/vnd.aai.asyncapi;version=2.0.0", "x-parser-message-name": "channelMessage", - "x-parser-message-parsed": true, - "x-parser-original-traits": [ + "traits": [ { "headers": { "properties": { @@ -219,10 +215,8 @@ export const MarkdownYAMLSubtypeChanges = `## Breaking x-parser-schema-id: type: object x-parser-schema-id: - schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 x-parser-message-name: channelMessage - x-parser-message-parsed: true - x-parser-original-traits: + traits: - headers: properties: some-common-header: @@ -261,10 +255,8 @@ export const MarkdownYAMLSubtypeChanges = `## Breaking x-parser-schema-id: type: object x-parser-schema-id: - schemaFormat: application/vnd.aai.asyncapi;version=2.0.0 x-parser-message-name: channelMessage - x-parser-message-parsed: true - x-parser-original-traits: + traits: - headers: properties: some-common-header: diff --git a/test/fixtures/diff.fixtures.ts b/test/fixtures/diff.fixtures.ts index bcc4c8eb..394ac45e 100644 --- a/test/fixtures/diff.fixtures.ts +++ b/test/fixtures/diff.fixtures.ts @@ -50,24 +50,22 @@ export const diffOutput = [ type: 'object', 'x-parser-schema-id': '', }, - schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0', - 'x-parser-message-name': 'channelMessage', - 'x-parser-message-parsed': true, - 'x-parser-original-traits': [ + traits: [ { headers: { properties: { 'some-common-header': { type: 'string', - 'x-parser-schema-id': '' + 'x-parser-schema-id': '', }, }, type: 'object', - 'x-parser-schema-id': '' + 'x-parser-schema-id': '', }, 'x-some-extension': 'some extension', }, ], + 'x-parser-message-name': 'channelMessage', 'x-some-extension': 'some extension', }, }, @@ -89,24 +87,22 @@ export const diffOutput = [ type: 'object', 'x-parser-schema-id': '', }, - schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0', - 'x-parser-message-name': 'channelMessage', - 'x-parser-message-parsed': true, - 'x-parser-original-traits': [ + traits: [ { headers: { properties: { 'some-common-header': { type: 'string', - 'x-parser-schema-id': '' + 'x-parser-schema-id': '', }, }, type: 'object', - 'x-parser-schema-id': '' + 'x-parser-schema-id': '', }, 'x-some-extension': 'some extension', }, ], + 'x-parser-message-name': 'channelMessage', 'x-some-extension': 'some extension', }, }, diff --git a/test/fixtures/main.fixtures.ts b/test/fixtures/main.fixtures.ts index 289daf5c..6f0f120c 100644 --- a/test/fixtures/main.fixtures.ts +++ b/test/fixtures/main.fixtures.ts @@ -17,10 +17,8 @@ export const breakingChanges = [ type: 'object', 'x-parser-schema-id': '', }, - schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0', 'x-parser-message-name': 'channelMessage', - 'x-parser-message-parsed': true, - 'x-parser-original-traits': [ + traits: [ { headers: { properties: { @@ -67,10 +65,8 @@ export const nonBreakingChanges = [ type: 'object', 'x-parser-schema-id': '', }, - schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0', 'x-parser-message-name': 'channelMessage', - 'x-parser-message-parsed': true, - 'x-parser-original-traits': [ + traits: [ { headers: { properties: { @@ -111,10 +107,8 @@ export const diffOutput = { type: 'object', 'x-parser-schema-id': '', }, - schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0', 'x-parser-message-name': 'channelMessage', - 'x-parser-message-parsed': true, - 'x-parser-original-traits': [ + traits: [ { headers: { properties: { @@ -151,10 +145,8 @@ export const diffOutput = { type: 'object', 'x-parser-schema-id': '', }, - schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0', 'x-parser-message-name': 'channelMessage', - 'x-parser-message-parsed': true, - 'x-parser-original-traits': [ + traits: [ { headers: { properties: { @@ -216,10 +208,8 @@ export const changesWithOverrides = { type: 'object', 'x-parser-schema-id': '', }, - schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0', 'x-parser-message-name': 'channelMessage', - 'x-parser-message-parsed': true, - 'x-parser-original-traits': [ + traits: [ { headers: { properties: { @@ -256,10 +246,8 @@ export const changesWithOverrides = { type: 'object', 'x-parser-schema-id': '', }, - schemaFormat: 'application/vnd.aai.asyncapi;version=2.0.0', 'x-parser-message-name': 'channelMessage', - 'x-parser-message-parsed': true, - 'x-parser-original-traits': [ + traits: [ { headers: { properties: {