-
-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rulesets): add support for 2.5.0 AsyncAPI (#2292)
- Loading branch information
1 parent
7a67c81
commit 0cb2e85
Showing
10 changed files
with
174 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
packages/rulesets/src/asyncapi/functions/__tests__/asyncApi2PayloadValidation.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 63 additions & 8 deletions
71
packages/rulesets/src/asyncapi/functions/asyncApi2PayloadValidation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// import only 2.X.X AsyncAPI JSON Schemas for better treeshaking | ||
import * as asyncAPI2_0_0Schema from '@asyncapi/specs/schemas/2.0.0.json'; | ||
import * as asyncAPI2_1_0Schema from '@asyncapi/specs/schemas/2.1.0.json'; | ||
import * as asyncAPI2_2_0Schema from '@asyncapi/specs/schemas/2.2.0.json'; | ||
import * as asyncAPI2_3_0Schema from '@asyncapi/specs/schemas/2.3.0.json'; | ||
import * as asyncAPI2_4_0Schema from '@asyncapi/specs/schemas/2.4.0.json'; | ||
import * as asyncAPI2_5_0Schema from '@asyncapi/specs/schemas/2.5.0.json'; | ||
|
||
export type AsyncAPISpecVersion = keyof typeof specs; | ||
|
||
export const specs = { | ||
'2.0.0': asyncAPI2_0_0Schema, | ||
'2.1.0': asyncAPI2_1_0Schema, | ||
'2.2.0': asyncAPI2_2_0Schema, | ||
'2.3.0': asyncAPI2_3_0Schema, | ||
'2.4.0': asyncAPI2_4_0Schema, | ||
'2.5.0': asyncAPI2_5_0Schema, | ||
}; | ||
|
||
export function getCopyOfSchema(version: AsyncAPISpecVersion): Record<string, unknown> { | ||
return JSON.parse(JSON.stringify(specs[version])) as Record<string, unknown>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters