Skip to content

Commit

Permalink
feat: export AsyncAPISchema and v2 types (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
smoya authored Oct 20, 2022
1 parent 1e4553f commit 3479a32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ export { Parser };
export { stringify, unstringify } from './stringify';
export { fromURL, fromFile } from './from';
export { createAsyncAPIDocument, toAsyncAPIDocument, isAsyncAPIDocument } from './document';
export { DiagnosticSeverity };

export * from './old-api';

export { DiagnosticSeverity };
export type { AsyncAPISemver, Input, Diagnostic, SchemaValidateResult } from './types';
export type { AsyncAPISemver, Input, Diagnostic, SchemaValidateResult, AsyncAPISchema } from './types';
export type { ValidateOptions, ValidateOutput } from './validate';
export type { ParseOptions, ParseOutput } from './parse';
export type { StringifyOptions } from './stringify';
export type { ValidateSchemaInput, ParseSchemaInput, SchemaParser } from './schema-parser';
export type { v2 as SpecTypesV2 } from './spec-types';

export default Parser;
4 changes: 2 additions & 2 deletions src/schema-parser/spectral-rule-v2.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRulesetFunction } from '@stoplight/spectral-core';
import { aas2_0, aas2_1, aas2_2, aas2_3, aas2_4 } from '@stoplight/spectral-formats';
import { aas2_0, aas2_1, aas2_2, aas2_3, aas2_4, aas2_5 } from '@stoplight/spectral-formats';

import { validateSchema, getSchemaFormat, getDefaultSchemaFormat } from './index';
import { createDetailedAsyncAPI } from '../utils';
Expand All @@ -13,7 +13,7 @@ import type { v2 } from '../spec-types';
export function asyncApi2SchemaParserRule(parser: Parser): RuleDefinition {
return {
description: 'Custom schema must be correctly formatted from the point of view of the used format.',
formats: [aas2_0, aas2_1, aas2_2, aas2_3, aas2_4],
formats: [aas2_0, aas2_1, aas2_2, aas2_3, aas2_4, aas2_5],
message: '{{error}}',
severity: 'error',
type: 'validation',
Expand Down

0 comments on commit 3479a32

Please sign in to comment.