Repository navigation
refactor: add AsyncAPI Schema Parser - #573
Conversation
|
|
||
| export type Diagnostic = ISpectralDiagnostic; | ||
| export type SchemaValidateResult = IFunctionResult; | ||
| export type SchemaValidateError = IFunctionResult; |
There was a problem hiding this comment.
I changed the name to be more explicit about what it is in fact... just an error.
There was a problem hiding this comment.
It's not always an error, because from spectral you can also return info or warning severity, by this spectral team called it IFunctionResult not IFunctionError. Please change to the previous one.
There was a problem hiding this comment.
Rollbacked the rename! thanks for the catch
magicmatatjahu
left a comment
There was a problem hiding this comment.
Good, but we need some improvements :)
|
|
||
| export type Diagnostic = ISpectralDiagnostic; | ||
| export type SchemaValidateResult = IFunctionResult; | ||
| export type SchemaValidateError = IFunctionResult; |
There was a problem hiding this comment.
It's not always an error, because from spectral you can also return info or warning severity, by this spectral team called it IFunctionResult not IFunctionError. Please change to the previous one.
| @@ -1,4 +1,5 @@ | |||
| import type { ISpectralDiagnostic, IFunctionResult } from '@stoplight/spectral-core'; | |||
| import { JSONSchema7 }from "json-schema" | |||
There was a problem hiding this comment.
| import { JSONSchema7 }from "json-schema" | |
| import type { JSONSchema7 }from "json-schema" |
There was a problem hiding this comment.
Sorry, didn't commit. It is now, please check again.
| * @param {Object} version AsyncAPI version. | ||
| * @returns {Object} valid JSON Schema document describing format of AsyncAPI-valid schema for message payload | ||
| */ | ||
| function preparePayloadSchema2(asyncapiSchema: AsyncAPISchema, version: string) { |
| ]; | ||
| ['2.0.0', '2.1.0', '2.2.0', '2.3.0'].forEach(version => { | ||
|
|
||
| specVersions.forEach((version: string) => { |
There was a problem hiding this comment.
Removing the need for adding a new version every time a new spec version is out...
|
Kudos, SonarCloud Quality Gate passed! |
|
/rtm |








Description
This PR adds the AsyncAPI Schema Parser, which is compatible with Spectral validation functions.
Related issue(s)
#480