Skip to content

Commit

Permalink
fix: remove v2 Spectral schema rules from v3 rules (#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
smoya authored Jun 12, 2024
1 parent 3a14fd0 commit dc54de7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ruleset/v2/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
3 changes: 2 additions & 1 deletion test/validate.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AsyncAPIDocument } from '../src/models/v3/asyncapi';
import { Parser } from '../src/parser';
import { hasErrorDiagnostic, hasWarningDiagnostic } from '../src/utils';

Expand Down Expand Up @@ -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);
});
});

0 comments on commit dc54de7

Please sign in to comment.