From f51c4aa4eec1405fdf21acf71e6c4169f72bbf66 Mon Sep 17 00:00:00 2001 From: Aayush Kumar Sahu Date: Mon, 16 Dec 2024 23:13:56 +0530 Subject: [PATCH 1/3] handle AsyncAPI v3 for diff command --- package-lock.json | 13 +- package.json | 4 +- src/commands/diff.ts | 20 +- test/fixtures/specification-v3-diff.yml | 249 ++++++++++++++++++++++++ test/integration/diff.test.ts | 32 +-- 5 files changed, 280 insertions(+), 38 deletions(-) create mode 100644 test/fixtures/specification-v3-diff.yml diff --git a/package-lock.json b/package-lock.json index bbfefd34726..ef541dc57b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "@asyncapi/cli", - "version": "2.12.1", + "version": "2.13.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/cli", - "version": "2.12.1", + "version": "2.13.0", "license": "Apache-2.0", "dependencies": { "@asyncapi/avro-schema-parser": "^3.0.23", "@asyncapi/bundler": "^0.6.4", "@asyncapi/converter": "^1.6.2", - "@asyncapi/diff": "^0.4.1", + "@asyncapi/diff": "^0.5.0", "@asyncapi/generator": "^1.17.25", "@asyncapi/modelina-cli": "^4.0.0-next.48", "@asyncapi/openapi-schema-parser": "^3.0.24", @@ -264,10 +264,9 @@ "license": "BSD-3-Clause" }, "node_modules/@asyncapi/diff": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@asyncapi/diff/-/diff-0.4.1.tgz", - "integrity": "sha512-KtUvDi59e8IcpAaWh9oHEuH2C41QCIe5ar9hvISJ2c4AmIMLTGRdh7uaph+NEfvZYERz5ze9Ln4UvlY2chbB1g==", - "license": "Apache-2.0", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@asyncapi/diff/-/diff-0.5.0.tgz", + "integrity": "sha512-lvKuEBDUOqOQfFwaTJfNTLwztby2r/6mfwoH/l7f1Kyf+7tH2+73ChV0VfIF498FJNKrdivo8isbLzfgi/KNjQ==", "dependencies": { "fast-json-patch": "^3.0.0-1", "js-yaml": "^4.1.0", diff --git a/package.json b/package.json index 4b642f41ebe..66c7f450ad7 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "@asyncapi/avro-schema-parser": "^3.0.23", "@asyncapi/bundler": "^0.6.4", "@asyncapi/converter": "^1.6.2", - "@asyncapi/diff": "^0.4.1", + "@asyncapi/diff": "^0.5.0", "@asyncapi/generator": "^1.17.25", "@asyncapi/modelina-cli": "^4.0.0-next.48", "@asyncapi/openapi-schema-parser": "^3.0.24", @@ -172,4 +172,4 @@ "action:test": "cd github-action && make test" }, "types": "lib/index.d.ts" -} +} \ No newline at end of file diff --git a/src/commands/diff.ts b/src/commands/diff.ts index 4ce8ae431bc..a427ba61a8b 100644 --- a/src/commands/diff.ts +++ b/src/commands/diff.ts @@ -57,10 +57,6 @@ export default class Diff extends Command { try { firstDocument = await load(firstDocumentPath); - if (firstDocument.isAsyncAPI3()) { - this.error('Diff command does not support AsyncAPI v3 yet which was your first document, please checkout https://github.com/asyncapi/diff/issues/154'); - } - enableWatch(watchMode, { spec: firstDocument, handler: this, @@ -83,10 +79,6 @@ export default class Diff extends Command { try { secondDocument = await load(secondDocumentPath); - if (secondDocument.isAsyncAPI3()) { - this.error('Diff command does not support AsyncAPI v3 yet which was your second document, please checkout https://github.com/asyncapi/diff/issues/154'); - } - enableWatch(watchMode, { spec: secondDocument, handler: this, @@ -146,9 +138,9 @@ export default class Diff extends Command { throwOnBreakingChange(diffOutput, outputFormat); } } catch (error) { - if (error instanceof DiffBreakingChangeError) { + if (error instanceof DiffBreakingChangeError || error instanceof TypeError) { this.error(error); - } + } throw new ValidationError({ type: 'parser-error', err: error, @@ -196,15 +188,13 @@ function genericOutput(diffOutput: AsyncAPIDiff, outputType: string) { } async function parseDocuments(command: Command, firstDocument: Specification, secondDocument: Specification, flags: Record) { - const { document: newFirstDocumentParsed, status: firstDocumentStatus } = await parse(command, firstDocument, flags); - const { document: newSecondDocumentParsed, status: secondDocumentStatus } = await parse(command, secondDocument, flags); + const { document: firstDocumentParsed, status: firstDocumentStatus } = await parse(command, firstDocument, flags); + const { document: secondDocumentParsed, status: secondDocumentStatus } = await parse(command, secondDocument, flags); - if (!newFirstDocumentParsed || !newSecondDocumentParsed || firstDocumentStatus === 'invalid' || secondDocumentStatus === 'invalid') { + if (!firstDocumentParsed || !secondDocumentParsed || firstDocumentStatus === 'invalid' || secondDocumentStatus === 'invalid') { return; } - const firstDocumentParsed = convertToOldAPI(newFirstDocumentParsed); - const secondDocumentParsed = convertToOldAPI(newSecondDocumentParsed); return { firstDocumentParsed, secondDocumentParsed }; } diff --git a/test/fixtures/specification-v3-diff.yml b/test/fixtures/specification-v3-diff.yml new file mode 100644 index 00000000000..4ac1eb7aa85 --- /dev/null +++ b/test/fixtures/specification-v3-diff.yml @@ -0,0 +1,249 @@ +asyncapi: 3.0.0 +id: 'urn:example:com:smartylighting:streetlights:server' +info: + title: AsyncAPI App + version: 1.0.1 + description: This is a sample app. + termsOfService: 'https://asyncapi.com/terms/' + contact: + name: API Support + url: 'https://www.asyncapi.com/support' + email: support@asyncapi.org + license: + name: Apache 2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' + tags: + - name: e-commerce + - name: another-tag + description: Description... + externalDocs: + description: Find more info here + url: 'https://www.asyncapi.com' +defaultContentType: application/json +servers: + default: + host: 'api.streetlights.smartylighting.com:{port}' + protocol: mqtt + description: Test broker + variables: + port: + description: Secure connection (TLS) is available through port 8883. + default: '8883' + enum: + - '1883' + - '8883' + security: + - $ref: '#/components/securitySchemes/apiKey' + - type: oauth2 + flows: + implicit: + authorizationUrl: 'https://example.com/api/oauth/dialog' + availableScopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + scopes: + - 'write:pets' + - type: openIdConnect + openIdConnectUrl: https://example.com/api + scopes: + - 'some:scope:1' + - 'some:scope:2' + production: + host: 'api.streetlights.smartylighting.com:{port}' + pathname: /some/path-name + protocol: mqtt + description: Test broker + variables: + port: + description: Secure connection (TLS) is available through port 8883. + default: '1883' + enum: + - '1883' + - '8883' + security: + - $ref: '#/components/securitySchemes/apiKey' + withProtocol: + host: 'api.streetlights.smartylighting.com:{port}' + pathname: /some/path + protocol: mqtt + description: Test broker + variables: + port: + description: Secure connection (TLS) is available through port 8883. + default: '1883' + enum: + - '1883' + - '8883' + security: + - $ref: '#/components/securitySchemes/apiKey' +channels: + 'lightingMeasured': + address: 'smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured' + messages: + lightMeasured: + payload: + type: object + servers: + - $ref: '#/servers/production' + parameters: + streetlightId: + $ref: '#/components/parameters/streetlightId' + 'turnOn': + address: 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on' + messages: + lightMeasured: + $ref: '#/components/messages/lightMeasured' + subscribe.message.0: + $ref: '#/components/messages/turnOnOff' + customMessageId: + payload: + type: object + subscribe.message.2: + payload: + type: object + servers: + - $ref: '#/servers/default' + - $ref: '#/servers/production' + parameters: + streetlightId: + $ref: '#/components/parameters/streetlightId' + customChannelId: + address: 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/off' + messages: + turnOnOff: + $ref: '#/components/messages/turnOnOff' + parameters: + streetlightId: + $ref: '#/components/parameters/streetlightId' + x-channelId: customChannelId + 'dim': + address: 'smartylighting/streetlights/1/0/action/{streetlightId}/dim' + messages: + dimLight: + $ref: '#/components/messages/dimLight' + parameters: + streetlightId: + $ref: '#/components/parameters/streetlightId' +operations: + receiveLightMeasured: + action: receive + channel: + $ref: '#/channels/lightingMeasured' + messages: + - $ref: '#/channels/lightingMeasured/messages/lightMeasured' + 'receiveTurnOn': + action: receive + channel: + $ref: '#/channels/turnOn' + messages: + - $ref: '#/channels/turnOn/messages/lightMeasured' + 'smartylighting/streetlights/1/0/action/{streetlightId}/turn/on.subscribe': + action: send + channel: + $ref: '#/channels/turnOn' + messages: + - $ref: '#/channels/turnOn/messages/customMessageId' + - $ref: '#/channels/turnOn/messages/subscribe.message.2' + turnOnOff: + action: send + channel: + $ref: '#/channels/customChannelId' + messages: + - $ref: '#/channels/customChannelId/messages/turnOnOff' + dimLight: + action: send + channel: + $ref: '#/channels/dim' + security: + - type: oauth2 + flows: + implicit: + authorizationUrl: 'https://example.com/api/oauth/dialog' + availableScopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + scopes: + - 'write:pets' + messages: + - $ref: '#/channels/dim/messages/dimLight' +components: + messages: + lightMeasured: + summary: >- + Inform about environmental lighting conditions for a particular + streetlight. + payload: + $ref: '#/components/schemas/lightMeasuredPayload' + turnOnOff: + summary: Command a particular streetlight to turn the lights on or off. + payload: + $ref: '#/components/schemas/turnOnOffPayload' + dimLight: + summary: Command a particular streetlight to dim the lights. + payload: + $ref: '#/components/schemas/dimLightPayload' + schemas: + lightMeasuredPayload: + type: object + properties: + lumens: + type: integer + minimum: 0 + description: Light intensity measured in lumens. + sentAt: + $ref: '#/components/schemas/sentAt' + turnOnOffPayload: + type: object + properties: + command: + type: string + enum: + - 'on' + - 'off' + description: Whether to turn on or off the light. + sentAt: + $ref: '#/components/schemas/sentAt' + dimLightPayload: + type: object + properties: + percentage: + type: integer + description: Percentage to which the light should be dimmed to. + minimum: 0 + maximum: 100 + sentAt: + $ref: '#/components/schemas/sentAt' + sentAt: + type: string + format: date-time + description: Date and time when the message was sent. + securitySchemes: + apiKey: + type: apiKey + in: user + description: Provide your API key as the user and leave the password empty. + flows: + type: oauth2 + flows: + implicit: + authorizationUrl: 'https://example.com/api/oauth/dialog' + availableScopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + openIdConnect: + type: openIdConnect + openIdConnectUrl: https://example.com/api + scopes: + - 'some:scope:1' + - 'some:scope:2' + unusedFlows: + type: oauth2 + flows: + implicit: + authorizationUrl: 'https://example.com/api/oauth/dialog' + availableScopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + parameters: + streetlightId: + description: The ID of the streetlight. diff --git a/test/integration/diff.test.ts b/test/integration/diff.test.ts index 5f814a2400c..4b70aa0aa34 100644 --- a/test/integration/diff.test.ts +++ b/test/integration/diff.test.ts @@ -2,39 +2,43 @@ import { expect, test } from '@oclif/test'; const asyncapiv3 = './test/fixtures/specification-v3.yml'; +const asyncapiv3Diff = './test/fixtures/specification-v3-diff.yml'; const asyncapiv2 = './test/fixtures/specification.yml'; const noChangesJson = '"{\\n \\"changes\\": []\\n}\\n"'; const breakingChangesJson = '"[\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/protocol\\",\\n \\"before\\": \\"mqtt\\",\\n \\"after\\": \\"http\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/url\\",\\n \\"before\\": \\"mqtt://test.mosquitto.org\\",\\n \\"after\\": \\"http://test.mosquitto.org\\",\\n \\"type\\": \\"breaking\\"\\n }\\n]\\n"'; -const nonBreakingChangesJson = '"[\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/channels/user~1signedup\\",\\n \\"after\\": {\\n \\"subscribe\\": {\\n \\"message\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\",\\n \\"x-parser-original-schema-format\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"schemaFormat\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"x-parser-original-payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-parsed\\": true\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/info/title\\",\\n \\"before\\": \\"Streetlights API\\",\\n \\"after\\": \\"Streetlights API V2\\",\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/components\\",\\n \\"after\\": {\\n \\"messages\\": {\\n \\"UserSignedUp\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\",\\n \\"x-parser-original-schema-format\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"schemaFormat\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"x-parser-original-payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-parsed\\": true\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n }\\n]\\n"'; -const unclassifiedChangesJson = '"[\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n }\\n]\\n"'; -const commonJsonOutput = '{\\n \\"changes\\": [\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/channels/user~1signedup\\",\\n \\"after\\": {\\n \\"subscribe\\": {\\n \\"message\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\",\\n \\"x-parser-original-schema-format\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"schemaFormat\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"x-parser-original-payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-parsed\\": true\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/protocol\\",\\n \\"before\\": \\"mqtt\\",\\n \\"after\\": \\"http\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/url\\",\\n \\"before\\": \\"mqtt://test.mosquitto.org\\",\\n \\"after\\": \\"http://test.mosquitto.org\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/info/title\\",\\n \\"before\\": \\"Streetlights API\\",\\n \\"after\\": \\"Streetlights API V2\\",\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/components\\",\\n \\"after\\": {\\n \\"messages\\": {\\n \\"UserSignedUp\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\",\\n \\"x-parser-original-schema-format\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"schemaFormat\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"x-parser-original-payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-parsed\\": true\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n }\\n ]\\n}\\n'; -const customJsonOutput = '"{\\n \\"changes\\": [\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/channels/user~1signedup\\",\\n \\"after\\": {\\n \\"subscribe\\": {\\n \\"message\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\",\\n \\"x-parser-original-schema-format\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"schemaFormat\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"x-parser-original-payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-parsed\\": true\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/protocol\\",\\n \\"before\\": \\"mqtt\\",\\n \\"after\\": \\"http\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/url\\",\\n \\"before\\": \\"mqtt://test.mosquitto.org\\",\\n \\"after\\": \\"http://test.mosquitto.org\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/info/title\\",\\n \\"before\\": \\"Streetlights API\\",\\n \\"after\\": \\"Streetlights API V2\\",\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/components\\",\\n \\"after\\": {\\n \\"messages\\": {\\n \\"UserSignedUp\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\",\\n \\"x-parser-original-schema-format\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"schemaFormat\\": \\"application/vnd.aai.asyncapi;version=2.1.0\\",\\n \\"x-parser-original-payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-parsed\\": true\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n }\\n ]\\n}\\n"'; +const nonBreakingChangesJson = '"[\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/channels/user~1signedup\\",\\n \\"after\\": {\\n \\"subscribe\\": {\\n \\"message\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\"\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/info/title\\",\\n \\"before\\": \\"Streetlights API\\",\\n \\"after\\": \\"Streetlights API V2\\",\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/components\\",\\n \\"after\\": {\\n \\"messages\\": {\\n \\"UserSignedUp\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\"\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n }\\n]\\n"'; +const unclassifiedChangesJson = '"[\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n }\\n]\\n"'; +const commonJsonOutput = '{\\n \\"changes\\": [\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/channels/user~1signedup\\",\\n \\"after\\": {\\n \\"subscribe\\": {\\n \\"message\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\"\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/protocol\\",\\n \\"before\\": \\"mqtt\\",\\n \\"after\\": \\"http\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/url\\",\\n \\"before\\": \\"mqtt://test.mosquitto.org\\",\\n \\"after\\": \\"http://test.mosquitto.org\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/info/title\\",\\n \\"before\\": \\"Streetlights API\\",\\n \\"after\\": \\"Streetlights API V2\\",\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/components\\",\\n \\"after\\": {\\n \\"messages\\": {\\n \\"UserSignedUp\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\"\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n }\\n ]\\n}\\n'; +const customJsonOutput = '"{\\n \\"changes\\": [\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id\\",\\n \\"before\\": \\"\\",\\n \\"after\\": \\"\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/light~1measured/publish/message/payload/properties/id/minimum\\",\\n \\"before\\": 0,\\n \\"after\\": 1,\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/channels/user~1signedup\\",\\n \\"after\\": {\\n \\"subscribe\\": {\\n \\"message\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\"\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/protocol\\",\\n \\"before\\": \\"mqtt\\",\\n \\"after\\": \\"http\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/mosquitto/url\\",\\n \\"before\\": \\"mqtt://test.mosquitto.org\\",\\n \\"after\\": \\"http://test.mosquitto.org\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/info/title\\",\\n \\"before\\": \\"Streetlights API\\",\\n \\"after\\": \\"Streetlights API V2\\",\\n \\"type\\": \\"non-breaking\\"\\n },\\n {\\n \\"action\\": \\"add\\",\\n \\"path\\": \\"/components\\",\\n \\"after\\": {\\n \\"messages\\": {\\n \\"UserSignedUp\\": {\\n \\"payload\\": {\\n \\"type\\": \\"object\\",\\n \\"properties\\": {\\n \\"displayName\\": {\\n \\"type\\": \\"string\\",\\n \\"description\\": \\"Name of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"email\\": {\\n \\"type\\": \\"string\\",\\n \\"format\\": \\"email\\",\\n \\"description\\": \\"Email of the user\\",\\n \\"x-parser-schema-id\\": \\"\\"\\n }\\n },\\n \\"x-parser-schema-id\\": \\"\\"\\n },\\n \\"x-parser-message-name\\": \\"UserSignedUp\\"\\n }\\n }\\n },\\n \\"type\\": \\"non-breaking\\"\\n }\\n ]\\n}\\n"'; +const commonJsonOutputV3 = '"{\\n \\"changes\\": [\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/operations/smartylighting~1streetlights~11~10~1action~1{streetlightId}~1turn~1on.subscribe/channel/servers/1/pathname\\",\\n \\"before\\": \\"/some/path\\",\\n \\"after\\": \\"/some/path-name\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/operations/smartylighting~1streetlights~11~10~1action~1{streetlightId}~1turn~1on.subscribe/channel/servers/0/variables/port/default\\",\\n \\"before\\": \\"1883\\",\\n \\"after\\": \\"8883\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/operations/receiveTurnOn/channel/servers/1/pathname\\",\\n \\"before\\": \\"/some/path\\",\\n \\"after\\": \\"/some/path-name\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/operations/receiveTurnOn/channel/servers/0/variables/port/default\\",\\n \\"before\\": \\"1883\\",\\n \\"after\\": \\"8883\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/operations/receiveLightMeasured/channel/servers/0/pathname\\",\\n \\"before\\": \\"/some/path\\",\\n \\"after\\": \\"/some/path-name\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/turnOn/servers/1/pathname\\",\\n \\"before\\": \\"/some/path\\",\\n \\"after\\": \\"/some/path-name\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/turnOn/servers/0/variables/port/default\\",\\n \\"before\\": \\"1883\\",\\n \\"after\\": \\"8883\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/channels/lightingMeasured/servers/0/pathname\\",\\n \\"before\\": \\"/some/path\\",\\n \\"after\\": \\"/some/path-name\\",\\n \\"type\\": \\"unclassified\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/production/pathname\\",\\n \\"before\\": \\"/some/path\\",\\n \\"after\\": \\"/some/path-name\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/servers/default/variables/port/default\\",\\n \\"before\\": \\"1883\\",\\n \\"after\\": \\"8883\\",\\n \\"type\\": \\"breaking\\"\\n },\\n {\\n \\"action\\": \\"edit\\",\\n \\"path\\": \\"/info/title\\",\\n \\"before\\": \\"AsyncAPI Sample App\\",\\n \\"after\\": \\"AsyncAPI App\\",\\n \\"type\\": \\"non-breaking\\"\\n }\\n ]\\n}\\n"'; const noChangesYaml = '"changes: []\\n\\n"'; -const commonYamlOutput = '"changes:\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/x-parser-original-payload/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/x-parser-original-payload/properties/sentAt/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/x-parser-original-payload/properties/lumens/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/x-parser-original-payload/properties/id/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/x-parser-original-payload/properties/id/minimum\\n before: 0\\n after: 1\\n type: unclassified\\n - action: edit\\n path: /channels/light~1measured/publish/message/payload/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: /channels/light~1measured/publish/message/payload/properties/id/minimum\\n before: 0\\n after: 1\\n type: unclassified\\n - action: add\\n path: /channels/user~1signedup\\n after:\\n subscribe:\\n message:\\n payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-name: UserSignedUp\\n x-parser-original-schema-format: application/vnd.aai.asyncapi;version=2.1.0\\n schemaFormat: application/vnd.aai.asyncapi;version=2.1.0\\n x-parser-original-payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-parsed: true\\n type: non-breaking\\n - action: edit\\n path: /servers/mosquitto/protocol\\n before: mqtt\\n after: http\\n type: breaking\\n - action: edit\\n path: /servers/mosquitto/url\\n before: mqtt://test.mosquitto.org\\n after: http://test.mosquitto.org\\n type: breaking\\n - action: edit\\n path: /info/title\\n before: Streetlights API\\n after: Streetlights API V2\\n type: non-breaking\\n - action: add\\n path: /components\\n after:\\n messages:\\n UserSignedUp:\\n payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-name: UserSignedUp\\n x-parser-original-schema-format: application/vnd.aai.asyncapi;version=2.1.0\\n schemaFormat: application/vnd.aai.asyncapi;version=2.1.0\\n x-parser-original-payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-parsed: true\\n type: non-breaking\\n\\n"'; +const commonYamlOutput = '"changes:\\n - action: edit\\n path: /channels/light~1measured/publish/message/payload/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: >-\\n /channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id\\n before: \\n after: \\n type: unclassified\\n - action: edit\\n path: /channels/light~1measured/publish/message/payload/properties/id/minimum\\n before: 0\\n after: 1\\n type: unclassified\\n - action: add\\n path: /channels/user~1signedup\\n after:\\n subscribe:\\n message:\\n payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-name: UserSignedUp\\n type: non-breaking\\n - action: edit\\n path: /servers/mosquitto/protocol\\n before: mqtt\\n after: http\\n type: breaking\\n - action: edit\\n path: /servers/mosquitto/url\\n before: mqtt://test.mosquitto.org\\n after: http://test.mosquitto.org\\n type: breaking\\n - action: edit\\n path: /info/title\\n before: Streetlights API\\n after: Streetlights API V2\\n type: non-breaking\\n - action: add\\n path: /components\\n after:\\n messages:\\n UserSignedUp:\\n payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-name: UserSignedUp\\n type: non-breaking\\n\\n"'; // eslint-disable-next-line quotes -const markdownJsonOutput = "\"## Unclassified\\n\\n\\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/properties/sentAt/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/properties/lumens/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/minimum`\\n - **Action**: edit\\n - **Before**: 0\\n - **After**: 1\\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/id/minimum`\\n - **Action**: edit\\n - **Before**: 0\\n - **After**: 1\\n \\n\\n## Non-breaking\\n\\n\\n - **Path**: `/channels/user~1signedup`\\n - **Action**: add\\n -
\\n After \\n \\n ```json\\n {\\n \\\"subscribe\\\": {\\n \\\"message\\\": {\\n \\\"payload\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"displayName\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"Name of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"email\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"format\\\": \\\"email\\\",\\n \\\"description\\\": \\\"Email of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n }\\n },\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"x-parser-message-name\\\": \\\"UserSignedUp\\\",\\n \\\"x-parser-original-schema-format\\\": \\\"application/vnd.aai.asyncapi;version=2.1.0\\\",\\n \\\"schemaFormat\\\": \\\"application/vnd.aai.asyncapi;version=2.1.0\\\",\\n \\\"x-parser-original-payload\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"displayName\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"Name of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"email\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"format\\\": \\\"email\\\",\\n \\\"description\\\": \\\"Email of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n }\\n },\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"x-parser-message-parsed\\\": true\\n }\\n }\\n }\\n ``` \\n
\\n \\n \\n - **Path**: `/info/title`\\n - **Action**: edit\\n - **Before**: Streetlights API\\n - **After**: Streetlights API V2\\n \\n - **Path**: `/components`\\n - **Action**: add\\n -
\\n After \\n \\n ```json\\n {\\n \\\"messages\\\": {\\n \\\"UserSignedUp\\\": {\\n \\\"payload\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"displayName\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"Name of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"email\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"format\\\": \\\"email\\\",\\n \\\"description\\\": \\\"Email of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n }\\n },\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"x-parser-message-name\\\": \\\"UserSignedUp\\\",\\n \\\"x-parser-original-schema-format\\\": \\\"application/vnd.aai.asyncapi;version=2.1.0\\\",\\n \\\"schemaFormat\\\": \\\"application/vnd.aai.asyncapi;version=2.1.0\\\",\\n \\\"x-parser-original-payload\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"displayName\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"Name of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"email\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"format\\\": \\\"email\\\",\\n \\\"description\\\": \\\"Email of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n }\\n },\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"x-parser-message-parsed\\\": true\\n }\\n }\\n }\\n ``` \\n
\\n \\n \\n\\n## Breaking\\n\\n\\n - **Path**: `/servers/mosquitto/protocol`\\n - **Action**: edit\\n - **Before**: mqtt\\n - **After**: http\\n \\n - **Path**: `/servers/mosquitto/url`\\n - **Action**: edit\\n - **Before**: mqtt://test.mosquitto.org\\n - **After**: http://test.mosquitto.org\\n \\n\\n\""; -const markdownYamlOutput = '"## Unclassified\\n\\n\\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/properties/sentAt/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/properties/lumens/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/x-parser-original-payload/properties/id/minimum`\\n - **Action**: edit\\n - **Before**: 0\\n - **After**: 1\\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/id/minimum`\\n - **Action**: edit\\n - **Before**: 0\\n - **After**: 1\\n \\n\\n## Non-breaking\\n\\n\\n - **Path**: `/channels/user~1signedup`\\n - **Action**: add\\n -
\\n After \\n \\n ```yaml\\n subscribe:\\n message:\\n payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-name: UserSignedUp\\n x-parser-original-schema-format: application/vnd.aai.asyncapi;version=2.1.0\\n schemaFormat: application/vnd.aai.asyncapi;version=2.1.0\\n x-parser-original-payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-parsed: true\\n \\n ``` \\n
\\n \\n \\n - **Path**: `/info/title`\\n - **Action**: edit\\n - **Before**: Streetlights API\\n - **After**: Streetlights API V2\\n \\n - **Path**: `/components`\\n - **Action**: add\\n -
\\n After \\n \\n ```yaml\\n messages:\\n UserSignedUp:\\n payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-name: UserSignedUp\\n x-parser-original-schema-format: application/vnd.aai.asyncapi;version=2.1.0\\n schemaFormat: application/vnd.aai.asyncapi;version=2.1.0\\n x-parser-original-payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-parsed: true\\n \\n ``` \\n
\\n \\n \\n\\n## Breaking\\n\\n\\n - **Path**: `/servers/mosquitto/protocol`\\n - **Action**: edit\\n - **Before**: mqtt\\n - **After**: http\\n \\n - **Path**: `/servers/mosquitto/url`\\n - **Action**: edit\\n - **Before**: mqtt://test.mosquitto.org\\n - **After**: http://test.mosquitto.org\\n \\n\\n"'; +const markdownJsonOutput = "\"## Unclassified\\n\\n\\n - **Path**: `/channels/light~1measured/publish/message/payload/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/id/minimum`\\n - **Action**: edit\\n - **Before**: 0\\n - **After**: 1\\n \\n\\n## Non-breaking\\n\\n\\n - **Path**: `/channels/user~1signedup`\\n - **Action**: add\\n -
\\n After \\n \\n ```json\\n {\\n \\\"subscribe\\\": {\\n \\\"message\\\": {\\n \\\"payload\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"displayName\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"Name of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"email\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"format\\\": \\\"email\\\",\\n \\\"description\\\": \\\"Email of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n }\\n },\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"x-parser-message-name\\\": \\\"UserSignedUp\\\"\\n }\\n }\\n }\\n ``` \\n
\\n \\n \\n - **Path**: `/info/title`\\n - **Action**: edit\\n - **Before**: Streetlights API\\n - **After**: Streetlights API V2\\n \\n - **Path**: `/components`\\n - **Action**: add\\n -
\\n After \\n \\n ```json\\n {\\n \\\"messages\\\": {\\n \\\"UserSignedUp\\\": {\\n \\\"payload\\\": {\\n \\\"type\\\": \\\"object\\\",\\n \\\"properties\\\": {\\n \\\"displayName\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"description\\\": \\\"Name of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"email\\\": {\\n \\\"type\\\": \\\"string\\\",\\n \\\"format\\\": \\\"email\\\",\\n \\\"description\\\": \\\"Email of the user\\\",\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n }\\n },\\n \\\"x-parser-schema-id\\\": \\\"\\\"\\n },\\n \\\"x-parser-message-name\\\": \\\"UserSignedUp\\\"\\n }\\n }\\n }\\n ``` \\n
\\n \\n \\n\\n## Breaking\\n\\n\\n - **Path**: `/servers/mosquitto/protocol`\\n - **Action**: edit\\n - **Before**: mqtt\\n - **After**: http\\n \\n - **Path**: `/servers/mosquitto/url`\\n - **Action**: edit\\n - **Before**: mqtt://test.mosquitto.org\\n - **After**: http://test.mosquitto.org\\n \\n\\n\""; +const markdownYamlOutput = '"## Unclassified\\n\\n\\n - **Path**: `/channels/light~1measured/publish/message/payload/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/sentAt/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/lumens/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/id/x-parser-schema-id`\\n - **Action**: edit\\n - **Before**: \\n - **After**: \\n \\n - **Path**: `/channels/light~1measured/publish/message/payload/properties/id/minimum`\\n - **Action**: edit\\n - **Before**: 0\\n - **After**: 1\\n \\n\\n## Non-breaking\\n\\n\\n - **Path**: `/channels/user~1signedup`\\n - **Action**: add\\n -
\\n After \\n \\n ```yaml\\n subscribe:\\n message:\\n payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-name: UserSignedUp\\n \\n ``` \\n
\\n \\n \\n - **Path**: `/info/title`\\n - **Action**: edit\\n - **Before**: Streetlights API\\n - **After**: Streetlights API V2\\n \\n - **Path**: `/components`\\n - **Action**: add\\n -
\\n After \\n \\n ```yaml\\n messages:\\n UserSignedUp:\\n payload:\\n type: object\\n properties:\\n displayName:\\n type: string\\n description: Name of the user\\n x-parser-schema-id: \\n email:\\n type: string\\n format: email\\n description: Email of the user\\n x-parser-schema-id: \\n x-parser-schema-id: \\n x-parser-message-name: UserSignedUp\\n \\n ``` \\n
\\n \\n \\n\\n## Breaking\\n\\n\\n - **Path**: `/servers/mosquitto/protocol`\\n - **Action**: edit\\n - **Before**: mqtt\\n - **After**: http\\n \\n - **Path**: `/servers/mosquitto/url`\\n - **Action**: edit\\n - **Before**: mqtt://test.mosquitto.org\\n - **After**: http://test.mosquitto.org\\n \\n\\n"'; describe('diff', () => { - describe('should handle AsyncAPI v3 document correctly', () => { + describe('comparing AsyncAPI v2 and v3 documents', () => { test .stderr() .stdout() .command(['diff', asyncapiv3, asyncapiv2]) - .it('give error when first document', (ctx, done) => { - expect(ctx.stderr).to.equal('Error: Diff command does not support AsyncAPI v3 yet which was your first document, please checkout https://github.com/asyncapi/diff/issues/154\n'); + .it('give error when different AsyncAPI version', (ctx, done) => { + expect(ctx.stderr).to.equal('TypeError: diff between different AsyncAPI version is not allowed\n'); expect(ctx.stdout).to.equal(''); done(); }); + }); + describe('should handle AsyncAPI v3 document correctly', () => { test .stderr() .stdout() - .command(['diff', asyncapiv2, asyncapiv3]) - .it('give error when second document', (ctx, done) => { - expect(ctx.stderr).to.equal('Error: Diff command does not support AsyncAPI v3 yet which was your second document, please checkout https://github.com/asyncapi/diff/issues/154\n'); - expect(ctx.stdout).to.equal(''); + .command(['diff', asyncapiv3, asyncapiv3Diff, '--no-error', '--format=json']) + .it('give error when different AsyncAPI version', (ctx, done) => { + expect(JSON.stringify(ctx.stdout)).to.equal(commonJsonOutputV3); + expect(ctx.stderr).to.equal(''); done(); }); }); From ac2ca2930806e897f66fee6f8b3a8bcc02aa3303 Mon Sep 17 00:00:00 2001 From: Aayush Kumar Sahu Date: Mon, 16 Dec 2024 23:18:10 +0530 Subject: [PATCH 2/3] remove unused import --- src/commands/diff.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/diff.ts b/src/commands/diff.ts index a427ba61a8b..ca286e07255 100644 --- a/src/commands/diff.ts +++ b/src/commands/diff.ts @@ -14,7 +14,7 @@ import { DiffOverrideJSONError, } from '../core/errors/diff-error'; import { specWatcher } from '../core/globals'; -import { parse, convertToOldAPI } from '../core/parser'; +import { parse } from '../core/parser'; import type { SpecWatcherParams } from '../core/globals'; import { diffFlags } from '../core/flags/diff.flags'; From e9fdd792ee4f30513ba683a411eee98bdfe5eaf3 Mon Sep 17 00:00:00 2001 From: Ashish Padhy <100484401+Shurtu-gal@users.noreply.github.com> Date: Fri, 20 Dec 2024 14:53:29 +0530 Subject: [PATCH 3/3] chore: add changeset --- .changeset/silent-olives-battle.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/silent-olives-battle.md diff --git a/.changeset/silent-olives-battle.md b/.changeset/silent-olives-battle.md new file mode 100644 index 00000000000..2cc367dbafc --- /dev/null +++ b/.changeset/silent-olives-battle.md @@ -0,0 +1,5 @@ +--- +"@asyncapi/cli": patch +--- + +Handle AsyncAPI v3 in diff command