Skip to content

Commit 3890886

Browse files
frantumachar0n
andcommitted
feat(apidom-ls): fix schema rule for missing core keywords
Co-authored-by: Vladimír Gorej <[email protected]>
1 parent db70831 commit 3890886

File tree

6 files changed

+49
-5
lines changed

6 files changed

+49
-5
lines changed

packages/apidom-ls/src/config/asyncapi/bindings/kafka/message-binding/lint/0-1-0/key--type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { LinterMeta } from '../../../../../../../apidom-language-types';
66
const keyTypeLint: LinterMeta = {
77
code: ApilintCodes.ASYNCAPI2_KAFKA_MESSAGE_BINDING_FIELD_KEY_TYPE,
88
source: 'apilint',
9-
message: 'key must be an object (Schema or AVRO Schema)',
9+
message: 'key must be a schema object, a boolean JSON schema, or an AVRO Schema',
1010
severity: DiagnosticSeverity.Error,
1111
linterFunction: 'apilintElementOrClass',
1212
linterParams: ['schema', 'boolean'],

packages/apidom-ls/src/config/asyncapi/bindings/kafka/message-binding/lint/0-2-0/key--type.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { LinterMeta } from '../../../../../../../apidom-language-types';
66
const keyTypeLint: LinterMeta = {
77
code: ApilintCodes.ASYNCAPI2_KAFKA_MESSAGE_BINDING_FIELD_KEY_TYPE,
88
source: 'apilint',
9-
message: 'key must be an object (Schema or AVRO Schema)',
9+
message: 'key must be a schema object, a boolean JSON schema, or an AVRO Schema',
1010
severity: DiagnosticSeverity.Error,
1111
linterFunction: 'apilintElementOrClass',
1212
linterParams: ['schema', 'boolean'],

packages/apidom-ls/src/config/openapi/header/lint/schema--mutually-exclusive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const schemaMutuallyExclusiveLint: LinterMeta = {
1919
params: [['content']],
2020
},
2121
],
22-
targetSpecs: OpenAPI30,
22+
targetSpecs: OpenAPI3,
2323
};
2424

2525
export default schemaMutuallyExclusiveLint;

packages/apidom-ls/src/config/openapi/parameter/lint/schema--mutually-exclusive.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const schemaMutuallyExclusiveLint: LinterMeta = {
1919
params: [['content']],
2020
},
2121
],
22-
targetSpecs: OpenAPI30,
22+
targetSpecs: OpenAPI3,
2323
};
2424

2525
export default schemaMutuallyExclusiveLint;

packages/apidom-ls/test/validate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2519,7 +2519,7 @@ describe('apidom-ls-validate', function () {
25192519
character: 24,
25202520
},
25212521
},
2522-
message: 'additionalItems must be a schema',
2522+
message: 'additionalItems must be a schema object or a boolean JSON schema',
25232523
severity: 1,
25242524
code: 10020,
25252525
source: 'apilint',

ti-15770.log

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[10:44:32.248] Global cache location '/home/frantuma/.cache/typescript/5.3', safe file path '/dati/dev/progetti/swagger/projects/apidom/master/apidom/node_modules/typescript/lib/typingSafeList.json', types map path /dati/dev/progetti/swagger/projects/apidom/master/apidom/node_modules/typescript/lib/typesMap.json
2+
[10:44:32.249] Processing cache location '/home/frantuma/.cache/typescript/5.3'
3+
[10:44:32.249] Trying to find '/home/frantuma/.cache/typescript/5.3/package.json'...
4+
[10:44:32.250] Loaded content of '/home/frantuma/.cache/typescript/5.3/package.json':
5+
{
6+
"private": true,
7+
"dependencies": {
8+
"types-registry": "^0.1.679"
9+
}
10+
}
11+
[10:44:32.250] Loaded content of '/home/frantuma/.cache/typescript/5.3/package-lock.json':
12+
{
13+
"name": "5.3",
14+
"lockfileVersion": 3,
15+
"requires": true,
16+
"packages": {
17+
"": {
18+
"dependencies": {
19+
"types-registry": "^0.1.679"
20+
}
21+
},
22+
"node_modules/types-registry": {
23+
"version": "0.1.679",
24+
"resolved": "https://registry.npmjs.org/types-registry/-/types-registry-0.1.679.tgz",
25+
"integrity": "sha512-XQ5kE50Pi7aiyJ45lJ2j2ZhF+1SP0luJ/8vDHnnB4fNKcoGd+VxylnfSW/NAXN2NvO5qUyGbPt/UdsDEyvzVkw=="
26+
}
27+
}
28+
}
29+
[10:44:32.250] Finished processing cache location '/home/frantuma/.cache/typescript/5.3'
30+
[10:44:32.250] Process id: 15780
31+
[10:44:32.251] NPM location: /home/frantuma/.nvm/versions/node/v20.4.0/bin/npm (explicit '--npmLocation' not provided)
32+
[10:44:32.251] validateDefaultNpmLocation: false
33+
[10:44:32.251] Npm config file: /home/frantuma/.cache/typescript/5.3/package.json
34+
[10:44:32.251] Updating types-registry npm package...
35+
[10:44:32.251] Exec: /home/frantuma/.nvm/versions/node/v20.4.0/bin/npm install --ignore-scripts types-registry@latest
36+
[10:44:33.744] Succeeded. stdout:
37+
38+
up to date, audited 2 packages in 1s
39+
40+
found 0 vulnerabilities
41+
42+
[10:44:33.744] Updated types-registry npm package
43+
[10:44:33.785] Closing file watchers for project '/home/frantuma/.local/share/JetBrains/Toolbox/apps/webstorm/plugins/javascript-impl/jsLanguageServicesImpl/typescript/tsconfig.json'
44+
[10:44:33.785] No watchers are registered for project '/home/frantuma/.local/share/JetBrains/Toolbox/apps/webstorm/plugins/javascript-impl/jsLanguageServicesImpl/typescript/tsconfig.json'

0 commit comments

Comments
 (0)