From f6704d902c38000ce8f25c4ae62790dbc084a41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Gorej?= Date: Mon, 6 Feb 2023 10:22:43 +0100 Subject: [PATCH] fix(ls): make IMBMQ Channel Bindings topic field always optional (#2523) Refs #2522 --- .../ibmmq/channel-binding/lint/0-1-0/index.ts | 2 - .../lint/0-1-0/topic--required.ts | 38 ------------------- .../channel-binding/lint/latest/index.ts | 2 - .../lint/latest/topic--required.ts | 37 ------------------ 4 files changed, 79 deletions(-) delete mode 100644 packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/0-1-0/topic--required.ts delete mode 100644 packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/latest/topic--required.ts diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/0-1-0/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/0-1-0/index.ts index 9b606e27ff..393c9d80e0 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/0-1-0/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/0-1-0/index.ts @@ -4,7 +4,6 @@ import queueTypeLint from './queue--type'; import queueRequiredLint from './queue--required'; import queueTopicMutuallyExclusiveLint from './queue-topic--mutually-exclusive'; import topicTypeLint from './topic--type'; -import topicRequiredLint from './topic--required'; import maxMsgLengthTypeLint from './max-msg-length--type'; const lints = [ @@ -13,7 +12,6 @@ const lints = [ queueRequiredLint, queueTopicMutuallyExclusiveLint, topicTypeLint, - topicRequiredLint, maxMsgLengthTypeLint, allowedFieldsLint, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/0-1-0/topic--required.ts b/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/0-1-0/topic--required.ts deleted file mode 100644 index 041b3cb7d3..0000000000 --- a/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/0-1-0/topic--required.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { DiagnosticSeverity } from 'vscode-languageserver-types'; - -import ApilintCodes from '../../../../../../codes'; -import { LinterMeta } from '../../../../../../../apidom-language-types'; - -const topicRequiredLint: LinterMeta = { - code: ApilintCodes.ASYNCAPI2_IBMMQ_CHANNEL_BINDING_FIELD_TOPIC_REQUIRED, - source: 'apilint', - message: "should always have a 'topic'", - severity: DiagnosticSeverity.Error, - linterFunction: 'hasRequiredField', - linterParams: ['topic'], - marker: 'key', - conditions: [ - { - targets: [{ path: 'destinationType' }], - function: 'apilintContainsValue', - params: ['topic'], - }, - { - targets: [{ path: 'bindingVersion' }], - function: 'apilintValueOrArray', - params: [['0.1.0']], - }, - ], - data: { - quickFix: [ - { - message: "add 'topic' field", - action: 'addChild', - snippetYaml: 'topic: \n ', - snippetJson: '"topic": {},\n ', - }, - ], - }, -}; - -export default topicRequiredLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/latest/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/latest/index.ts index 9b606e27ff..393c9d80e0 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/latest/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/latest/index.ts @@ -4,7 +4,6 @@ import queueTypeLint from './queue--type'; import queueRequiredLint from './queue--required'; import queueTopicMutuallyExclusiveLint from './queue-topic--mutually-exclusive'; import topicTypeLint from './topic--type'; -import topicRequiredLint from './topic--required'; import maxMsgLengthTypeLint from './max-msg-length--type'; const lints = [ @@ -13,7 +12,6 @@ const lints = [ queueRequiredLint, queueTopicMutuallyExclusiveLint, topicTypeLint, - topicRequiredLint, maxMsgLengthTypeLint, allowedFieldsLint, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/latest/topic--required.ts b/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/latest/topic--required.ts deleted file mode 100644 index d27a17ee92..0000000000 --- a/packages/apidom-ls/src/config/asyncapi/bindings/ibmmq/channel-binding/lint/latest/topic--required.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { DiagnosticSeverity } from 'vscode-languageserver-types'; - -import ApilintCodes from '../../../../../../codes'; -import { LinterMeta } from '../../../../../../../apidom-language-types'; - -const topicRequiredLint: LinterMeta = { - code: ApilintCodes.ASYNCAPI2_IBMMQ_CHANNEL_BINDING_FIELD_TOPIC_REQUIRED, - source: 'apilint', - message: "should always have a 'topic'", - severity: DiagnosticSeverity.Error, - linterFunction: 'hasRequiredField', - linterParams: ['topic'], - marker: 'key', - conditions: [ - { - targets: [{ path: 'destinationType' }], - function: 'apilintContainsValue', - params: ['topic'], - }, - { - function: 'missingField', - params: ['bindingVersion'], - }, - ], - data: { - quickFix: [ - { - message: "add 'topic' field", - action: 'addChild', - snippetYaml: 'topic: \n ', - snippetJson: '"topic": {},\n ', - }, - ], - }, -}; - -export default topicRequiredLint;