Skip to content

Commit f8cfb73

Browse files
authored
feat(ls): add AsyncAPI 3 validation for compatible keywords (#5096)
1 parent b0071a3 commit f8cfb73

File tree

451 files changed

+6355
-313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

451 files changed

+6355
-313
lines changed

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/allowed-fields.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const allowedFieldsLint: LinterMeta = {
78
code: ApilintCodes.NOT_ALLOWED_FIELDS,
@@ -24,6 +25,7 @@ const allowedFieldsLint: LinterMeta = {
2425
'x-',
2526
],
2627
marker: 'key',
28+
targetSpecs: AsyncAPI2,
2729
};
2830

2931
export default allowedFieldsLint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/asyncapi--required.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const asyncapiRequiredLint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_ASYNCAPI_REQUIRED,
@@ -21,6 +22,7 @@ const asyncapiRequiredLint: LinterMeta = {
2122
},
2223
],
2324
},
25+
targetSpecs: AsyncAPI2,
2426
};
2527

2628
export default asyncapiRequiredLint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/channels--required.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const channelsRequiredLint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_CHANNELS_REQUIRED,
@@ -21,6 +22,7 @@ const channelsRequiredLint: LinterMeta = {
2122
},
2223
],
2324
},
25+
targetSpecs: AsyncAPI2,
2426
};
2527

2628
export default channelsRequiredLint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/channels--type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const channelsTypeLint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_CHANNELS_TYPE,
@@ -13,6 +14,7 @@ const channelsTypeLint: LinterMeta = {
1314
marker: 'value',
1415
target: 'channels',
1516
data: {},
17+
targetSpecs: AsyncAPI2,
1618
};
1719

1820
export default channelsTypeLint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/components--type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const componentsTypeLint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_COMPONENTS_TYPE,
@@ -13,6 +14,7 @@ const componentsTypeLint: LinterMeta = {
1314
marker: 'value',
1415
target: 'components',
1516
data: {},
17+
targetSpecs: AsyncAPI2,
1618
};
1719

1820
export default componentsTypeLint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/default-content-type--type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const defaultContentTypeTypeLint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_DEFAULT_CONTENT_TYPE_TYPE,
@@ -13,6 +14,7 @@ const defaultContentTypeTypeLint: LinterMeta = {
1314
marker: 'value',
1415
target: 'defaultContentType',
1516
data: {},
17+
targetSpecs: AsyncAPI2,
1618
};
1719

1820
export default defaultContentTypeTypeLint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/external-docs--type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const externalDocsTypeLint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_DEFAULT_CONTENT_TYPE_TYPE,
@@ -13,6 +14,7 @@ const externalDocsTypeLint: LinterMeta = {
1314
marker: 'value',
1415
target: 'externalDocs',
1516
data: {},
17+
targetSpecs: AsyncAPI2,
1618
};
1719

1820
export default externalDocsTypeLint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/id--format-uri.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const idFormatURILint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_ID_TYPE,
@@ -12,6 +13,7 @@ const idFormatURILint: LinterMeta = {
1213
marker: 'value',
1314
target: 'id',
1415
data: {},
16+
targetSpecs: AsyncAPI2,
1517
};
1618

1719
export default idFormatURILint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/info--required.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const infoRequiredLint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_INFO_REQUIRED,
@@ -21,6 +22,7 @@ const infoRequiredLint: LinterMeta = {
2122
},
2223
],
2324
},
25+
targetSpecs: AsyncAPI2,
2426
};
2527

2628
export default infoRequiredLint;

packages/apidom-ls/src/config/asyncapi/asyncapi2/lint/info--type.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types';
22

33
import ApilintCodes from '../../../codes.ts';
44
import { LinterMeta } from '../../../../apidom-language-types.ts';
5+
import { AsyncAPI2 } from '../../target-specs.ts';
56

67
const infoTypeLint: LinterMeta = {
78
code: ApilintCodes.ASYNCAPI2_ASYNC_API_FIELD_INFO_TYPE,
@@ -13,6 +14,7 @@ const infoTypeLint: LinterMeta = {
1314
marker: 'value',
1415
target: 'info',
1516
data: {},
17+
targetSpecs: AsyncAPI2,
1618
};
1719

1820
export default infoTypeLint;

0 commit comments

Comments
 (0)