From 1ac243791fc452bb35f1c0b9d8ae58b251155a41 Mon Sep 17 00:00:00 2001 From: Aayush Kumar Sahu Date: Wed, 13 Nov 2024 00:34:45 +0530 Subject: [PATCH] half done standard for v3 --- src/main.ts | 3 +-- src/standards/v3.ts | 29 +++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 8997222..f0595c2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -35,8 +35,7 @@ export function diff( config: Config = {} ): AsyncAPIDiff { if (incompatibleDocuments(firstDocument, secondDocument)) { - // TODO: decide how to show the errors - return 'Incompatible docs'; + throw new TypeError('Incompatible documents'); } const standard = getStandardFromVersion(firstDocument); diff --git a/src/standards/v3.ts b/src/standards/v3.ts index a84def5..ba1d155 100644 --- a/src/standards/v3.ts +++ b/src/standards/v3.ts @@ -1,7 +1,5 @@ import { breaking, nonBreaking, unclassified } from '../constants'; -// TODO: check the new spec changes - /** * The standard object for AsyncAPI v3 * @@ -13,4 +11,31 @@ export const standard = { remove: breaking, edit: breaking, }, + '/id': { + add: nonBreaking, + remove: breaking, + edit: breaking, + }, + '/info': { + add: nonBreaking, + remove: breaking, + edit: nonBreaking, + }, + '/info/title': {}, + '/info/version': {}, + '/info/description': {}, + '/info/termsOfService': {}, + '/info/contact': {}, + '/info/license': {}, + '/info/tags': {}, + '/info/externalDocs': {}, + '/servers': {}, + '/defaultContentType': {}, + '/channels': {}, + '/operations': {}, + '/components': { + add: nonBreaking, + remove: nonBreaking, + edit: nonBreaking, + } };