Skip to content

Commit

Permalink
feat(apidom-ls): fix schema rule for missing core keywords
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimír Gorej <vladimir.gorej@gmail.com>
  • Loading branch information
frantuma and char0n committed Jan 17, 2024
1 parent db70831 commit 3890886
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 5 deletions.
Expand Up @@ -6,7 +6,7 @@ import { LinterMeta } from '../../../../../../../apidom-language-types';
const keyTypeLint: LinterMeta = {
code: ApilintCodes.ASYNCAPI2_KAFKA_MESSAGE_BINDING_FIELD_KEY_TYPE,
source: 'apilint',
message: 'key must be an object (Schema or AVRO Schema)',
message: 'key must be a schema object, a boolean JSON schema, or an AVRO Schema',
severity: DiagnosticSeverity.Error,
linterFunction: 'apilintElementOrClass',
linterParams: ['schema', 'boolean'],
Expand Down
Expand Up @@ -6,7 +6,7 @@ import { LinterMeta } from '../../../../../../../apidom-language-types';
const keyTypeLint: LinterMeta = {
code: ApilintCodes.ASYNCAPI2_KAFKA_MESSAGE_BINDING_FIELD_KEY_TYPE,
source: 'apilint',
message: 'key must be an object (Schema or AVRO Schema)',
message: 'key must be a schema object, a boolean JSON schema, or an AVRO Schema',
severity: DiagnosticSeverity.Error,
linterFunction: 'apilintElementOrClass',
linterParams: ['schema', 'boolean'],
Expand Down
Expand Up @@ -19,7 +19,7 @@ const schemaMutuallyExclusiveLint: LinterMeta = {
params: [['content']],
},
],
targetSpecs: OpenAPI30,
targetSpecs: OpenAPI3,
};

export default schemaMutuallyExclusiveLint;
Expand Up @@ -19,7 +19,7 @@ const schemaMutuallyExclusiveLint: LinterMeta = {
params: [['content']],
},
],
targetSpecs: OpenAPI30,
targetSpecs: OpenAPI3,
};

export default schemaMutuallyExclusiveLint;
2 changes: 1 addition & 1 deletion packages/apidom-ls/test/validate.ts
Expand Up @@ -2519,7 +2519,7 @@ describe('apidom-ls-validate', function () {
character: 24,
},
},
message: 'additionalItems must be a schema',
message: 'additionalItems must be a schema object or a boolean JSON schema',
severity: 1,
code: 10020,
source: 'apilint',
Expand Down
44 changes: 44 additions & 0 deletions ti-15770.log
@@ -0,0 +1,44 @@
[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
[10:44:32.249] Processing cache location '/home/frantuma/.cache/typescript/5.3'
[10:44:32.249] Trying to find '/home/frantuma/.cache/typescript/5.3/package.json'...
[10:44:32.250] Loaded content of '/home/frantuma/.cache/typescript/5.3/package.json':
{
"private": true,
"dependencies": {
"types-registry": "^0.1.679"
}
}
[10:44:32.250] Loaded content of '/home/frantuma/.cache/typescript/5.3/package-lock.json':
{
"name": "5.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"dependencies": {
"types-registry": "^0.1.679"
}
},
"node_modules/types-registry": {
"version": "0.1.679",
"resolved": "https://registry.npmjs.org/types-registry/-/types-registry-0.1.679.tgz",
"integrity": "sha512-XQ5kE50Pi7aiyJ45lJ2j2ZhF+1SP0luJ/8vDHnnB4fNKcoGd+VxylnfSW/NAXN2NvO5qUyGbPt/UdsDEyvzVkw=="
}
}
}
[10:44:32.250] Finished processing cache location '/home/frantuma/.cache/typescript/5.3'
[10:44:32.250] Process id: 15780
[10:44:32.251] NPM location: /home/frantuma/.nvm/versions/node/v20.4.0/bin/npm (explicit '--npmLocation' not provided)
[10:44:32.251] validateDefaultNpmLocation: false
[10:44:32.251] Npm config file: /home/frantuma/.cache/typescript/5.3/package.json
[10:44:32.251] Updating types-registry npm package...
[10:44:32.251] Exec: /home/frantuma/.nvm/versions/node/v20.4.0/bin/npm install --ignore-scripts types-registry@latest
[10:44:33.744] Succeeded. stdout:

up to date, audited 2 packages in 1s

found 0 vulnerabilities

[10:44:33.744] Updated types-registry npm package
[10:44:33.785] Closing file watchers for project '/home/frantuma/.local/share/JetBrains/Toolbox/apps/webstorm/plugins/javascript-impl/jsLanguageServicesImpl/typescript/tsconfig.json'
[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 comments on commit 3890886

Please sign in to comment.