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, + } };