diff --git a/src/ruleset/v2/ruleset.ts b/src/ruleset/v2/ruleset.ts index bbd3a65af..7e80f89f6 100644 --- a/src/ruleset/v2/ruleset.ts +++ b/src/ruleset/v2/ruleset.ts @@ -192,6 +192,7 @@ export const v2CoreRuleset = { export const v2SchemasRuleset = (parser: Parser) => { return { description: 'Schemas AsyncAPI 2.x.x ruleset.', + formats: AsyncAPIFormats.filterByMajorVersions(['2']).formats(), rules: { 'asyncapi2-schemas': asyncApi2SchemaParserRule(parser), 'asyncapi2-schema-default': { diff --git a/test/validate.spec.ts b/test/validate.spec.ts index 60b85730a..5a5ab00ad 100644 --- a/test/validate.spec.ts +++ b/test/validate.spec.ts @@ -1,3 +1,4 @@ +import { AsyncAPIDocument } from '../src/models/v3/asyncapi'; import { Parser } from '../src/parser'; import { hasErrorDiagnostic, hasWarningDiagnostic } from '../src/utils'; @@ -91,7 +92,7 @@ describe('validate()', function() { } }; const { document, diagnostics } = await parser.parse(documentRaw, { validateOptions: { allowedSeverity: { warning: false } } }); - console.log(diagnostics); expect(diagnostics).toHaveLength(0); + expect(document).toBeInstanceOf(AsyncAPIDocument); }); });