Skip to content

Commit

Permalink
half done standard for v3
Browse files Browse the repository at this point in the history
  • Loading branch information
aayushmau5 committed Nov 12, 2024
1 parent a0431e3 commit 1ac2437
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
29 changes: 27 additions & 2 deletions src/standards/v3.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { breaking, nonBreaking, unclassified } from '../constants';

// TODO: check the new spec changes

/**
* The standard object for AsyncAPI v3
*
Expand All @@ -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,
}
};

0 comments on commit 1ac2437

Please sign in to comment.