diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/completion/0-1-0.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/completion/0-1-0.ts new file mode 100644 index 0000000000..a168ea6718 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/completion/0-1-0.ts @@ -0,0 +1,98 @@ +import { + ApidomCompletionItem, + CompletionFormat, + CompletionType, +} from '../../../../../../apidom-language-types.ts'; + +const completion: ApidomCompletionItem[] = [ + { + label: 'destination', + insertText: 'destination', + kind: 14, + format: CompletionFormat.QUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '**Optional**, defaults to the channel name. The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ.', + }, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], + }, + { + label: 'destinationType', + insertText: 'destinationType', + kind: 14, + format: CompletionFormat.QUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '**Optional**, defaults to `queue`. The type of destination, which MUST be either `exchange` or `queue` or `fifo-queue`. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel.', + }, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], + }, + { + target: 'destinationType', + label: 'destinationType', + insertText: 'exchange', + kind: 12, + format: CompletionFormat.QUOTED, + type: CompletionType.VALUE, + insertTextFormat: 2, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], + }, + { + target: 'destinationType', + label: 'destinationType', + insertText: 'queue', + kind: 12, + format: CompletionFormat.QUOTED, + type: CompletionType.VALUE, + insertTextFormat: 2, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], + }, + { + target: 'destinationType', + label: 'destinationType', + insertText: 'fifo-queue', + kind: 12, + format: CompletionFormat.QUOTED, + type: CompletionType.VALUE, + insertTextFormat: 2, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], + }, +]; + +export default completion; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/completion/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/completion/index.ts index 69d4744a56..248dfae819 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/completion/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/completion/index.ts @@ -1,4 +1,5 @@ import completion0_0_1Items from './0-0-1.ts'; +import completion0_1_0Items from './0-1-0.ts'; import completionLatestItems from './latest.ts'; import { ApidomCompletionItem, @@ -8,6 +9,7 @@ import { const completion: ApidomCompletionItem[] = [ ...completion0_0_1Items, + ...completion0_1_0Items, ...completionLatestItems, { label: 'bindingVersion', @@ -18,7 +20,7 @@ const completion: ApidomCompletionItem[] = [ insertTextFormat: 2, documentation: { kind: 'markdown', - value: '**Optional**, defaults to `0.0.1`. The version of this binding.', + value: '**Optional**, defaults to `0.1.0`. The version of this binding.', }, }, { @@ -30,6 +32,15 @@ const completion: ApidomCompletionItem[] = [ type: CompletionType.VALUE, insertTextFormat: 2, }, + { + target: 'bindingVersion', + label: '0.1.0', + insertText: '0.1.0', + kind: 12, + format: CompletionFormat.QUOTED_FORCED, + type: CompletionType.VALUE, + insertTextFormat: 2, + }, ]; export default completion; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/destination-type--equals.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/destination-type--equals.ts new file mode 100644 index 0000000000..111998a1c6 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/destination-type--equals.ts @@ -0,0 +1,25 @@ +import { DiagnosticSeverity } from 'vscode-languageserver-types'; + +import ApilintCodes from '../../../../../../codes.ts'; +import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; + +const destinationTypeEqualsLint: LinterMeta = { + code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE_EQUALS, + source: 'apilint', + message: 'destinationType must be one of allowed values', + severity: DiagnosticSeverity.Error, + linterFunction: 'apilintValueOrArray', + linterParams: [['queue', 'exchange', 'fifo-queue']], + marker: 'value', + target: 'destinationType', + data: {}, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.0.1']], + }, + ], +}; + +export default destinationTypeEqualsLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/index.ts index 6f4f252468..e47ad1a445 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/index.ts @@ -1,7 +1,7 @@ import allowedFieldsLint from './allowed-fields.ts'; import destinationTypeLint from './destination--type.ts'; -import destinationTypeTypeLint from './destination-type--type.ts'; +import destinationTypeEqualsLint from './destination-type--equals.ts'; -const lints = [destinationTypeLint, destinationTypeTypeLint, allowedFieldsLint]; +const lints = [destinationTypeLint, destinationTypeEqualsLint, allowedFieldsLint]; export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/allowed-fields.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/allowed-fields.ts new file mode 100644 index 0000000000..d72fc78d31 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/allowed-fields.ts @@ -0,0 +1,23 @@ +import { DiagnosticSeverity } from 'vscode-languageserver-types'; + +import ApilintCodes from '../../../../../../codes.ts'; +import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; + +const allowedFieldsLint: LinterMeta = { + code: ApilintCodes.NOT_ALLOWED_FIELDS, + source: 'apilint', + message: 'Object includes not allowed fields', + severity: DiagnosticSeverity.Error, + linterFunction: 'allowedFields', + linterParams: [['destination', 'destinationType', 'bindingVersion']], + marker: 'key', + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], +}; + +export default allowedFieldsLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/destination-type--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/destination--type.ts similarity index 70% rename from packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/destination-type--type.ts rename to packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/destination--type.ts index bfc8609435..d548ffdd4a 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-0-1/destination-type--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/destination--type.ts @@ -3,23 +3,23 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types'; import ApilintCodes from '../../../../../../codes.ts'; import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; -const destinationTypeTypeLint: LinterMeta = { - code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE_TYPE, +const destinationTypeLint: LinterMeta = { + code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE, source: 'apilint', - message: "'destinationType' value must be a string", + message: "'destination' value must be a string", severity: DiagnosticSeverity.Error, linterFunction: 'apilintType', linterParams: ['string'], marker: 'value', - target: 'destinationType', + target: 'destination', data: {}, conditions: [ { targets: [{ path: 'bindingVersion' }], function: 'apilintValueOrArray', - params: [['0.0.1']], + params: [['0.1.0']], }, ], }; -export default destinationTypeTypeLint; +export default destinationTypeLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/destination-type--equals.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/destination-type--equals.ts new file mode 100644 index 0000000000..f146bb3d1c --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/destination-type--equals.ts @@ -0,0 +1,25 @@ +import { DiagnosticSeverity } from 'vscode-languageserver-types'; + +import ApilintCodes from '../../../../../../codes.ts'; +import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; + +const destinationTypeEqualsLint: LinterMeta = { + code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE_EQUALS, + source: 'apilint', + message: 'destinationType must be one of allowed values', + severity: DiagnosticSeverity.Error, + linterFunction: 'apilintValueOrArray', + linterParams: [['queue', 'exchange', 'fifo-queue']], + marker: 'value', + target: 'destinationType', + data: {}, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], +}; + +export default destinationTypeEqualsLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/index.ts new file mode 100644 index 0000000000..e47ad1a445 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/0-1-0/index.ts @@ -0,0 +1,7 @@ +import allowedFieldsLint from './allowed-fields.ts'; +import destinationTypeLint from './destination--type.ts'; +import destinationTypeEqualsLint from './destination-type--equals.ts'; + +const lints = [destinationTypeLint, destinationTypeEqualsLint, allowedFieldsLint]; + +export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/index.ts index 2550e378fe..4d902a3a8c 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/index.ts @@ -1,7 +1,13 @@ import channelBinding0_0_1Lints from './0-0-1/index.ts'; +import channelBinding0_1_0Lints from './0-1-0/index.ts'; import channelBindingLatestLints from './latest/index.ts'; import bindingVersionTypeLint from './binding-version--type.ts'; -const lints = [...channelBinding0_0_1Lints, ...channelBindingLatestLints, bindingVersionTypeLint]; +const lints = [ + ...channelBinding0_0_1Lints, + ...channelBinding0_1_0Lints, + ...channelBindingLatestLints, + bindingVersionTypeLint, +]; export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/destination-type--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/destination-type--equals.ts similarity index 64% rename from packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/destination-type--type.ts rename to packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/destination-type--equals.ts index 6ab676ea67..01e9bc3dfc 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/destination-type--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/destination-type--equals.ts @@ -3,13 +3,13 @@ import { DiagnosticSeverity } from 'vscode-languageserver-types'; import ApilintCodes from '../../../../../../codes.ts'; import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; -const destinationTypeTypeLint: LinterMeta = { - code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE_TYPE, +const destinationTypeEqualsLint: LinterMeta = { + code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE_EQUALS, source: 'apilint', - message: "'destinationType' value must be a string", + message: 'destinationType must be one of allowed values', severity: DiagnosticSeverity.Error, - linterFunction: 'apilintType', - linterParams: ['string'], + linterFunction: 'apilintValueOrArray', + linterParams: [['queue', 'exchange', 'fifo-queue']], marker: 'value', target: 'destinationType', data: {}, @@ -21,4 +21,4 @@ const destinationTypeTypeLint: LinterMeta = { ], }; -export default destinationTypeTypeLint; +export default destinationTypeEqualsLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/index.ts index 6f4f252468..e47ad1a445 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/channel-binding/lint/latest/index.ts @@ -1,7 +1,7 @@ import allowedFieldsLint from './allowed-fields.ts'; import destinationTypeLint from './destination--type.ts'; -import destinationTypeTypeLint from './destination-type--type.ts'; +import destinationTypeEqualsLint from './destination-type--equals.ts'; -const lints = [destinationTypeLint, destinationTypeTypeLint, allowedFieldsLint]; +const lints = [destinationTypeLint, destinationTypeEqualsLint, allowedFieldsLint]; export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/0-0-1.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/0-0-1.ts index f4acc5545b..569b691df0 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/0-0-1.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/0-0-1.ts @@ -3,6 +3,7 @@ import { CompletionFormat, CompletionType, } from '../../../../../../apidom-language-types.ts'; +import { AsyncAPI2, AsyncAPI3 } from '../../../../target-specs.ts'; const completion: ApidomCompletionItem[] = [ { @@ -15,8 +16,30 @@ const completion: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Schema object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + '[Schema Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#referenceObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', }, + targetSpecs: AsyncAPI2, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.0.1']], + }, + ], + }, + { + label: 'headers', + insertText: 'headers', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Schema Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#referenceObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + }, + targetSpecs: AsyncAPI3, conditions: [ { targets: [{ path: 'bindingVersion' }], diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/0-1-0.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/0-1-0.ts new file mode 100644 index 0000000000..792cc3dfbf --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/0-1-0.ts @@ -0,0 +1,53 @@ +import { + ApidomCompletionItem, + CompletionFormat, + CompletionType, +} from '../../../../../../apidom-language-types.ts'; +import { AsyncAPI2, AsyncAPI3 } from '../../../../target-specs.ts'; + +const completion: ApidomCompletionItem[] = [ + { + label: 'headers', + insertText: 'headers', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Schema Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#referenceObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + }, + targetSpecs: AsyncAPI2, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], + }, + { + label: 'headers', + insertText: 'headers', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Schema Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#referenceObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + }, + targetSpecs: AsyncAPI3, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], + }, +]; + +export default completion; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/index.ts index 69d4744a56..248dfae819 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/index.ts @@ -1,4 +1,5 @@ import completion0_0_1Items from './0-0-1.ts'; +import completion0_1_0Items from './0-1-0.ts'; import completionLatestItems from './latest.ts'; import { ApidomCompletionItem, @@ -8,6 +9,7 @@ import { const completion: ApidomCompletionItem[] = [ ...completion0_0_1Items, + ...completion0_1_0Items, ...completionLatestItems, { label: 'bindingVersion', @@ -18,7 +20,7 @@ const completion: ApidomCompletionItem[] = [ insertTextFormat: 2, documentation: { kind: 'markdown', - value: '**Optional**, defaults to `0.0.1`. The version of this binding.', + value: '**Optional**, defaults to `0.1.0`. The version of this binding.', }, }, { @@ -30,6 +32,15 @@ const completion: ApidomCompletionItem[] = [ type: CompletionType.VALUE, insertTextFormat: 2, }, + { + target: 'bindingVersion', + label: '0.1.0', + insertText: '0.1.0', + kind: 12, + format: CompletionFormat.QUOTED_FORCED, + type: CompletionType.VALUE, + insertTextFormat: 2, + }, ]; export default completion; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/latest.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/latest.ts index b2f0236e4a..141606e900 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/latest.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/completion/latest.ts @@ -3,6 +3,7 @@ import { CompletionFormat, CompletionType, } from '../../../../../../apidom-language-types.ts'; +import { AsyncAPI2, AsyncAPI3 } from '../../../../target-specs.ts'; const completion: ApidomCompletionItem[] = [ { @@ -15,8 +16,29 @@ const completion: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Schema object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + '[Schema Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#referenceObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', }, + targetSpecs: AsyncAPI2, + conditions: [ + { + function: 'missingField', + params: ['bindingVersion'], + }, + ], + }, + { + label: 'headers', + insertText: 'headers', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Schema Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#referenceObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + }, + targetSpecs: AsyncAPI3, conditions: [ { function: 'missingField', diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/documentation.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/documentation.ts index e212a29678..8f4fa87b8e 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/documentation.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/documentation.ts @@ -1,14 +1,27 @@ +import { AsyncAPI2, AsyncAPI3 } from '../../../target-specs.ts'; + const documentation = [ { target: 'headers', - docs: '[Schema object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + docs: '[Schema Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#referenceObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + targetSpecs: AsyncAPI2, + }, + { + target: 'headers', + docs: '[Schema Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#referenceObject)\n\\\n\\\n**Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.', + targetSpecs: AsyncAPI3, }, { target: 'bindingVersion', - docs: '**Optional**, defaults to `0.0.1`. The version of this binding.', + docs: '**Optional**, defaults to `0.1.0`. The version of this binding.', + }, + { + docs: "#### [Message Binding Object](https://github.com/asyncapi/bindings/tree/master/anypointmq#message-binding-object)\n\nThe Anypoint MQ [Message Binding Object](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#message-bindings-object) is defined by a [JSON Schema](https://github.com/asyncapi/bindings/blob/master/anypointmq/json_schemas/message.json), which defines these fields:\n\nField Name | Type | Description\n---|:---:|---\n`headers` | [Schema Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#referenceObject) | **Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.\n`bindingVersion` | string | **Optional**, defaults to `0.1.0`. The version of this binding.\n\nNote that application headers must be specified in the [`headers` field of the standard Message Object](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#messageObjectHeaders) and are transmitted in the [`properties` section of the Anypoint MQ message](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/anypoint-mq-broker/).\nIn contrast, protocol headers such as `messageId` must be specified in the [`headers` field of the message binding object](https://github.com/asyncapi/bindings/tree/master/anypointmq#messageBindingObjectHeaders) and are transmitted in the [`headers` section of the Anypoint MQ message](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/anypoint-mq-broker/).\n\n### Examples\n\nThe following example shows a `channels` object with two channels, each having one operation (`subscribe` or `publish`) with one message. Only the message of the `subscribe` operation has a message binding object for `anypointmq`:\n\n\n\\\nYAML\n```yaml\nchannels:\n user/signup:\n publish:\n message:\n #...\n user/signedup:\n subscribe:\n message:\n headers:\n type: object\n properties:\n correlationId:\n description: Correlation ID set by application\n type: string\n payload:\n type: object\n properties:\n #...\n correlationId:\n description: Correlation ID is specified as a header and transmitted in the Anypoint MQ message properties section\n location: $message.header#/correlationId\n bindings:\n anypointmq:\n headers:\n type: object\n properties:\n messageId:\n type: string\n bindingVersion: '0.1.0'\n```", + targetSpecs: AsyncAPI2, }, { - docs: "#### [Message Binding Object](https://github.com/asyncapi/bindings/tree/master/anypointmq#message-binding-object)\n\nThe Anypoint MQ [Message Binding Object](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#message-bindings-object) is defined by a [JSON Schema](https://github.com/asyncapi/bindings/blob/master/anypointmq/json_schemas/message.json), which defines these fields:\n\nField Name | Type | Description\n---|:---:|---\n`headers` | [Schema Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject) | **Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.\n`bindingVersion` | string | **Optional**, defaults to `0.0.1`. The version of this binding.\n\nNote that application headers must be specified in the [`headers` field of the standard Message Object](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#messageObjectHeaders) and are transmitted in the [`properties` section of the Anypoint MQ message](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/anypoint-mq-broker/).\nIn contrast, protocol headers such as `messageId` must be specified in the [`headers` field of the message binding object](https://github.com/asyncapi/bindings/tree/master/anypointmq#messageBindingObjectHeaders) and are transmitted in the [`headers` section of the Anypoint MQ message](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/anypoint-mq-broker/).\n\n### Examples\n\nThe following example shows a `channels` object with two channels, each having one operation (`subscribe` or `publish`) with one message. Only the message of the `subscribe` operation has a message binding object for `anypointmq`:\n\n\n\\\nYAML\n```yaml\nchannels:\n user/signup:\n publish:\n message:\n #...\n user/signedup:\n subscribe:\n message:\n headers:\n type: object\n properties:\n correlationId:\n description: Correlation ID set by application\n type: string\n payload:\n type: object\n properties:\n #...\n correlationId:\n description: Correlation ID is specified as a header and transmitted in the Anypoint MQ message properties section\n location: $message.header#/correlationId\n bindings:\n anypointmq:\n headers:\n type: object\n properties:\n messageId:\n type: string\n bindingVersion: '0.0.1'\n```", + docs: "#### [Message Binding Object](https://github.com/asyncapi/bindings/tree/master/anypointmq#message-binding-object)\n\nThe Anypoint MQ [Message Binding Object](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#message-bindings-object) is defined by a [JSON Schema](https://github.com/asyncapi/bindings/blob/master/anypointmq/json_schemas/message.json), which defines these fields:\n\nField Name | Type | Description\n---|:---:|---\n`headers` | [Schema Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#referenceObject) | **Optional**. A Schema object containing the definitions for Anypoint MQ-specific headers (so-called protocol headers). This schema MUST be of type `object` and have a `properties` key. Examples of Anypoint MQ protocol headers are `messageId` and `messageGroupId`.\n`bindingVersion` | string | **Optional**, defaults to `0.1.0`. The version of this binding.\n\nNote that application headers must be specified in the [`headers` field of the standard Message Object](https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#messageObjectHeaders) and are transmitted in the [`properties` section of the Anypoint MQ message](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/anypoint-mq-broker/).\nIn contrast, protocol headers such as `messageId` must be specified in the [`headers` field of the message binding object](https://github.com/asyncapi/bindings/tree/master/anypointmq#messageBindingObjectHeaders) and are transmitted in the [`headers` section of the Anypoint MQ message](https://anypoint.mulesoft.com/exchange/portals/anypoint-platform/f1e97bc6-315a-4490-82a7-23abe036327a.anypoint-platform/anypoint-mq-broker/).\n\n### Examples\n\nThe following example shows a `channels` object with two channels, each having one operation (`subscribe` or `publish`) with one message. Only the message of the `subscribe` operation has a message binding object for `anypointmq`:\n\n\n\\\nYAML\n```yaml\nchannels:\n user/signup:\n publish:\n message:\n #...\n user/signedup:\n subscribe:\n message:\n headers:\n type: object\n properties:\n correlationId:\n description: Correlation ID set by application\n type: string\n payload:\n type: object\n properties:\n #...\n correlationId:\n description: Correlation ID is specified as a header and transmitted in the Anypoint MQ message properties section\n location: $message.header#/correlationId\n bindings:\n anypointmq:\n headers:\n type: object\n properties:\n messageId:\n type: string\n bindingVersion: '0.1.0'\n```", + targetSpecs: AsyncAPI3, }, ]; export default documentation; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/allowed-fields.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/allowed-fields.ts new file mode 100644 index 0000000000..e3be00fd3f --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/allowed-fields.ts @@ -0,0 +1,23 @@ +import { DiagnosticSeverity } from 'vscode-languageserver-types'; + +import ApilintCodes from '../../../../../../codes.ts'; +import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; + +const allowedFieldsLint: LinterMeta = { + code: ApilintCodes.NOT_ALLOWED_FIELDS, + source: 'apilint', + message: 'Object includes not allowed fields', + severity: DiagnosticSeverity.Error, + linterFunction: 'allowedFields', + linterParams: [['headers', 'bindingVersion']], + marker: 'key', + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], +}; + +export default allowedFieldsLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/headers--type.ts new file mode 100644 index 0000000000..4f1ddea0c2 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/headers--type.ts @@ -0,0 +1,25 @@ +import { DiagnosticSeverity } from 'vscode-languageserver-types'; + +import ApilintCodes from '../../../../../../codes.ts'; +import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; + +const headersTypeLint: LinterMeta = { + code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_MESSAGE_BINDING_FIELD_HEADERS_TYPE, + source: 'apilint', + message: 'headers must be an object or a boolean JSON schema', + severity: DiagnosticSeverity.Error, + linterFunction: 'apilintElementOrClass', + linterParams: [['schema', 'boolean']], + marker: 'value', + target: 'headers', + data: {}, + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], +}; + +export default headersTypeLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/index.ts new file mode 100644 index 0000000000..3ac8349328 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-1-0/index.ts @@ -0,0 +1,6 @@ +import allowedFieldsLint from './allowed-fields.ts'; +import headersTypeLint from './headers--type.ts'; + +const lints = [allowedFieldsLint, headersTypeLint]; + +export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/index.ts index 41049ac8ab..f2e1a89834 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/index.ts @@ -1,7 +1,13 @@ import messageBinding0_0_1Lints from './0-0-1/index.ts'; +import messageBinding0_1_0Lints from './0-1-0/index.ts'; import messageBindingLatestLints from './latest/index.ts'; import bindingVersionTypeLint from './binding-version--type.ts'; -const lints = [...messageBinding0_0_1Lints, ...messageBindingLatestLints, bindingVersionTypeLint]; +const lints = [ + ...messageBinding0_0_1Lints, + ...messageBinding0_1_0Lints, + ...messageBindingLatestLints, + bindingVersionTypeLint, +]; export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/0-1-0/allowed-fields.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/0-1-0/allowed-fields.ts new file mode 100644 index 0000000000..1304f42fb9 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/0-1-0/allowed-fields.ts @@ -0,0 +1,23 @@ +import { DiagnosticSeverity } from 'vscode-languageserver-types'; + +import ApilintCodes from '../../../../../../codes.ts'; +import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; + +const allowedFieldsLint: LinterMeta = { + code: ApilintCodes.NOT_ALLOWED_FIELDS, + source: 'apilint', + message: 'This object MUST NOT contain any properties. Its name is reserved for future use.', + severity: DiagnosticSeverity.Error, + linterFunction: 'allowedFields', + linterParams: [[]], + marker: 'key', + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.1.0']], + }, + ], +}; + +export default allowedFieldsLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/0-1-0/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/0-1-0/index.ts new file mode 100644 index 0000000000..47f7d48761 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/0-1-0/index.ts @@ -0,0 +1,5 @@ +import allowedFieldsLint from './allowed-fields.ts'; + +const lints = [allowedFieldsLint]; + +export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/index.ts index 5f4e715828..f8366ef454 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/operation-binding/lint/index.ts @@ -1,6 +1,11 @@ import operationBinding0_0_1Lints from './0-0-1/index.ts'; +import operationBinding0_1_0Lints from './0-1-0/index.ts'; import operationBindingLatestLints from './latest/index.ts'; -const lints = [...operationBinding0_0_1Lints, ...operationBindingLatestLints]; +const lints = [ + ...operationBinding0_0_1Lints, + ...operationBinding0_1_0Lints, + ...operationBindingLatestLints, +]; export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-0-1/allowed-fields.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-0-1/allowed-fields.ts new file mode 100644 index 0000000000..b74ea1351f --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-0-1/allowed-fields.ts @@ -0,0 +1,23 @@ +import { DiagnosticSeverity } from 'vscode-languageserver-types'; + +import ApilintCodes from '../../../../../../codes.ts'; +import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; + +const allowedFieldsLint: LinterMeta = { + code: ApilintCodes.NOT_ALLOWED_FIELDS, + source: 'apilint', + message: 'This object MUST NOT contain any properties. Its name is reserved for future use.', + severity: DiagnosticSeverity.Error, + linterFunction: 'allowedFields', + linterParams: [[]], + marker: 'key', + conditions: [ + { + targets: [{ path: 'bindingVersion' }], + function: 'apilintValueOrArray', + params: [['0.0.1']], + }, + ], +}; + +export default allowedFieldsLint; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-0-1/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-0-1/index.ts new file mode 100644 index 0000000000..47f7d48761 --- /dev/null +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-0-1/index.ts @@ -0,0 +1,5 @@ +import allowedFieldsLint from './allowed-fields.ts'; + +const lints = [allowedFieldsLint]; + +export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-1-0/allowed-fields.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-1-0/allowed-fields.ts index 709121fad1..1304f42fb9 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-1-0/allowed-fields.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/0-1-0/allowed-fields.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; const allowedFieldsLint: LinterMeta = { code: ApilintCodes.NOT_ALLOWED_FIELDS, source: 'apilint', - message: 'Object includes not allowed fields.', + message: 'This object MUST NOT contain any properties. Its name is reserved for future use.', severity: DiagnosticSeverity.Error, linterFunction: 'allowedFields', - linterParams: [['contentEncoding', 'messageType', 'bindingVersion']], + linterParams: [[]], marker: 'key', conditions: [ { diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/index.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/index.ts index 0bdc5898c0..363ecf6563 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/index.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/index.ts @@ -1,6 +1,7 @@ +import serverBinding0_0_1Lints from './0-0-1/index.ts'; import serverBinding0_1_0Lints from './0-1-0/index.ts'; import serverBindingLatestLints from './latest/index.ts'; -const lints = [...serverBinding0_1_0Lints, ...serverBindingLatestLints]; +const lints = [...serverBinding0_0_1Lints, ...serverBinding0_1_0Lints, ...serverBindingLatestLints]; export default lints; diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/latest/allowed-fields.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/latest/allowed-fields.ts index 61d64a9ebb..1d1ec3b58b 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/latest/allowed-fields.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/server-binding/lint/latest/allowed-fields.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types.ts'; const allowedFieldsLint: LinterMeta = { code: ApilintCodes.NOT_ALLOWED_FIELDS, source: 'apilint', - message: 'Object includes not allowed fields.', + message: 'This object MUST NOT contain any properties. Its name is reserved for future use.', severity: DiagnosticSeverity.Error, linterFunction: 'allowedFields', - linterParams: [['contentEncoding', 'messageType', 'bindingVersion']], + linterParams: [[]], marker: 'key', conditions: [ { diff --git a/packages/apidom-ls/src/config/asyncapi/config.ts b/packages/apidom-ls/src/config/asyncapi/config.ts index 9933a39313..e809593f73 100644 --- a/packages/apidom-ls/src/config/asyncapi/config.ts +++ b/packages/apidom-ls/src/config/asyncapi/config.ts @@ -59,7 +59,7 @@ import amqp1ServerBindingMeta from './bindings/amqp1/server-binding/meta.ts'; import anypointmqChannelBindingMeta from './bindings/anypointmq/channel-binding/meta.ts'; import anypointmqMessageBindingMeta from './bindings/anypointmq/message-binding/meta.ts'; import anypointmqOperationBindingMeta from './bindings/anypointmq/operation-binding/meta.ts'; -import anypointmqServerBidingMeta from './bindings/anypointmq/server-binding/meta.ts'; +import anypointmqServerBindingMeta from './bindings/anypointmq/server-binding/meta.ts'; // Google Cloud Pub/Sub import googlepubsubChannelBindingMeta from './bindings/googlepubsub/channel-binding/meta.ts'; import googlepubsubMessageBindingMeta from './bindings/googlepubsub/message-binding/meta.ts'; @@ -217,7 +217,7 @@ export default { anypointmqChannelBinding: anypointmqChannelBindingMeta, anypointmqMessageBinding: anypointmqMessageBindingMeta, anypointmqOperationBinding: anypointmqOperationBindingMeta, - anypointmqServerBiding: anypointmqServerBidingMeta, + anypointmqServerBinding: anypointmqServerBindingMeta, // Google Cloud Pub/Sub googlepubsubChannelBinding: googlepubsubChannelBindingMeta, googlepubsubMessageBinding: googlepubsubMessageBindingMeta, diff --git a/packages/apidom-ls/src/config/codes.ts b/packages/apidom-ls/src/config/codes.ts index 83081622fd..e7617adbb9 100644 --- a/packages/apidom-ls/src/config/codes.ts +++ b/packages/apidom-ls/src/config/codes.ts @@ -636,7 +636,7 @@ enum ApilintCodes { ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING = 1070000, ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_BINDING_VERSION = 1070100, ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE = 1070200, - ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE_TYPE = 1070300, + ASYNCAPI2_ANYPOINTMQ_CHANNEL_BINDING_FIELD_DESTINATION_TYPE_EQUALS = 1070300, ASYNCAPI2_ANYPOINTMQ_MESSAGE_BINDING = 1080000, ASYNCAPI2_ANYPOINTMQ_MESSAGE_BINDING_FIELD_HEADERS_TYPE = 1080100, diff --git a/packages/apidom-ls/test/asyncapi-anypointmq-bindings.ts b/packages/apidom-ls/test/asyncapi-anypointmq-bindings.ts new file mode 100644 index 0000000000..45b3e54aaa --- /dev/null +++ b/packages/apidom-ls/test/asyncapi-anypointmq-bindings.ts @@ -0,0 +1,647 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { assert } from 'chai'; +import { TextDocument } from 'vscode-languageserver-textdocument'; +import { Diagnostic, DiagnosticSeverity } from 'vscode-languageserver-types'; + +import getLanguageService from '../src/apidom-language-service.ts'; +import { + LanguageService, + LanguageServiceContext, + ValidationContext, +} from '../src/apidom-language-types.ts'; +import { metadata } from './metadata.ts'; +import { logPerformance, logLevel } from './test-utils.ts'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +const specChannelBindingAllowedFields001 = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-channel-binding-allowed-fields-0-0-1.yaml', + ), + ) + .toString(); + +const specChannelBindingAllowedFields010 = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-channel-binding-allowed-fields-0-1-0.yaml', + ), + ) + .toString(); + +const specChannelBindingAllowedFieldsLatest = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-channel-binding-allowed-fields-latest.yaml', + ), + ) + .toString(); + +const specChannelBindingDestinationType = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-channel-binding-destination-type.yaml', + ), + ) + .toString(); + +const specChannelBindingDestinationTypeEquals = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-channel-binding-destination-type-equals.yaml', + ), + ) + .toString(); + +const specMessageBindingAllowedFields001 = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-message-binding-allowed-fields-0-0-1.yaml', + ), + ) + .toString(); + +const specMessageBindingAllowedFields010 = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-message-binding-allowed-fields-0-1-0.yaml', + ), + ) + .toString(); + +const specMessageBindingAllowedFieldsLatest = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-message-binding-allowed-fields-latest.yaml', + ), + ) + .toString(); + +const specMessageBindingHeadersType = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-message-binding-headers-type.yaml', + ), + ) + .toString(); + +const specOperationBindingAllowedFields001 = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-operation-binding-allowed-fields-0-0-1.yaml', + ), + ) + .toString(); + +const specOperationBindingAllowedFields010 = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-operation-binding-allowed-fields-0-1-0.yaml', + ), + ) + .toString(); + +const specOperationBindingAllowedFieldsLatest = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-operation-binding-allowed-fields-latest.yaml', + ), + ) + .toString(); + +const specServerBindingAllowedFields001 = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-server-binding-allowed-fields-0-0-1.yaml', + ), + ) + .toString(); + +const specServerBindingAllowedFields010 = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-server-binding-allowed-fields-0-1-0.yaml', + ), + ) + .toString(); + +const specServerBindingAllowedFieldsLatest = fs + .readFileSync( + path.join( + __dirname, + 'fixtures', + 'validation', + 'asyncapi', + 'bindings', + 'anypointmq', + 'anypointmq-server-binding-allowed-fields-latest.yaml', + ), + ) + .toString(); + +describe('asyncapi anypointmq bindings test', function () { + const context: LanguageServiceContext = { + metadata: metadata(), + validatorProviders: [], + performanceLogs: logPerformance, + logLevel, + }; + + const languageService: LanguageService = getLanguageService(context); + + after(function () { + languageService.terminate(); + }); + + const validationContext: ValidationContext = { + comments: DiagnosticSeverity.Error, + maxNumberOfProblems: 100, + relatedInformation: false, + }; + + it('anypointmq channel binding - not allowed fields (v0.0.1)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-channel-binding-allowed-fields-0-0-1.yaml', + 'yaml', + 0, + specChannelBindingAllowedFields001, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: 'Object includes not allowed fields', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq channel binding - not allowed fields (v0.1.0)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-channel-binding-allowed-fields-0-1-0.yaml', + 'yaml', + 0, + specChannelBindingAllowedFields010, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: 'Object includes not allowed fields', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq channel binding - not allowed fields (latest)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-channel-binding-allowed-fields-latest.yaml', + 'yaml', + 0, + specChannelBindingAllowedFieldsLatest, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: 'Object includes not allowed fields', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq channel binding - destination field type (v0.0.1)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-channel-binding-destination-type.yaml', + 'yaml', + 0, + specChannelBindingDestinationType, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 8, character: 21 }, + end: { line: 8, character: 24 }, + }, + message: "'destination' value must be a string", + severity: 1, + code: 1070200, + source: 'apilint', + data: {}, + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq channel binding - destinationType field equals queue/exchange/fifo-queue (v0.0.1)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-channel-binding-destination-type-equals.yaml', + 'yaml', + 0, + specChannelBindingDestinationTypeEquals, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 8, character: 25 }, + end: { line: 8, character: 32 }, + }, + message: 'destinationType must be one of allowed values', + severity: 1, + code: 1070300, + source: 'apilint', + data: {}, + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq message binding - not allowed fields (v0.0.1)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-message-binding-allowed-fields-0-0-1.yaml', + 'yaml', + 0, + specMessageBindingAllowedFields001, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: 'Object includes not allowed fields', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq message binding - not allowed fields (v0.1.0)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-message-binding-allowed-fields-0-1-0.yaml', + 'yaml', + 0, + specMessageBindingAllowedFields010, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: 'Object includes not allowed fields', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq message binding - not allowed fields (latest)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-message-binding-allowed-fields-latest.yaml', + 'yaml', + 0, + specMessageBindingAllowedFieldsLatest, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: 'Object includes not allowed fields', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq message binding - headers field type (v0.0.1)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-message-binding-headers-type.yaml', + 'yaml', + 0, + specMessageBindingHeadersType, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 8, character: 17 }, + end: { line: 8, character: 20 }, + }, + message: 'headers must be an object or a boolean JSON schema', + severity: 1, + code: 1080100, + source: 'apilint', + data: {}, + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq operation binding - not allowed fields (v0.0.1)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-operation-binding-allowed-fields-0-0-1.yaml', + 'yaml', + 0, + specOperationBindingAllowedFields001, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: + 'This object MUST NOT contain any properties. Its name is reserved for future use.', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq operation binding - not allowed fields (v0.1.0)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-operation-binding-allowed-fields-0-1-0.yaml', + 'yaml', + 0, + specOperationBindingAllowedFields010, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: + 'This object MUST NOT contain any properties. Its name is reserved for future use.', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq operation binding - not allowed fields (latest)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-operation-binding-allowed-fields-latest.yaml', + 'yaml', + 0, + specOperationBindingAllowedFieldsLatest, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: + 'This object MUST NOT contain any properties. Its name is reserved for future use.', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq server binding - not allowed fields (v0.0.1)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-server-binding-allowed-fields-0-0-1.yaml', + 'yaml', + 0, + specServerBindingAllowedFields001, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: + 'This object MUST NOT contain any properties. Its name is reserved for future use.', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq server binding - not allowed fields (v0.1.0)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-server-binding-allowed-fields-0-1-0.yaml', + 'yaml', + 0, + specServerBindingAllowedFields010, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: + 'This object MUST NOT contain any properties. Its name is reserved for future use.', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); + + it('anypointmq server binding - not allowed fields (latest)', async function () { + const doc: TextDocument = TextDocument.create( + 'foo://bar/anypointmq-server-binding-allowed-fields-latest.yaml', + 'yaml', + 0, + specServerBindingAllowedFieldsLatest, + ); + + const result = await languageService.doValidation(doc, validationContext); + + const expected: Diagnostic[] = [ + { + range: { + start: { line: 7, character: 6 }, + end: { line: 7, character: 16 }, + }, + message: + 'This object MUST NOT contain any properties. Its name is reserved for future use.', + severity: 1, + code: 15000, + source: 'apilint', + }, + ]; + + assert.deepEqual(result, expected); + }); +}); diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-0-0-1.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-0-0-1.yaml new file mode 100644 index 0000000000..79011731e3 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-0-0-1.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +channels: + channel1: + bindings: + anypointmq: + foo: bar + bindingVersion: '0.0.1' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-0-1-0.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-0-1-0.yaml new file mode 100644 index 0000000000..b1d173c1d7 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-0-1-0.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +channels: + channel1: + bindings: + anypointmq: + foo: bar + bindingVersion: '0.1.0' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-latest.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-latest.yaml new file mode 100644 index 0000000000..dc40a7c488 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-allowed-fields-latest.yaml @@ -0,0 +1,9 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +channels: + channel1: + bindings: + anypointmq: + foo: bar diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-destination-type-equals.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-destination-type-equals.yaml new file mode 100644 index 0000000000..41f6d3b41a --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-destination-type-equals.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +channels: + channel1: + bindings: + anypointmq: + destinationType: invalid + bindingVersion: '0.0.1' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-destination-type.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-destination-type.yaml new file mode 100644 index 0000000000..d390ce068b --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-channel-binding-destination-type.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +channels: + channel1: + bindings: + anypointmq: + destination: 123 + bindingVersion: '0.0.1' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-0-0-1.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-0-0-1.yaml new file mode 100644 index 0000000000..bad5c0d648 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-0-0-1.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + messageBindings: + bindings1: + anypointmq: + foo: bar + bindingVersion: '0.0.1' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-0-1-0.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-0-1-0.yaml new file mode 100644 index 0000000000..a381ba01fe --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-0-1-0.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + messageBindings: + bindings1: + anypointmq: + foo: bar + bindingVersion: '0.1.0' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-latest.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-latest.yaml new file mode 100644 index 0000000000..52bcc8075f --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-allowed-fields-latest.yaml @@ -0,0 +1,9 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + messageBindings: + bindings1: + anypointmq: + foo: bar diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-headers-type.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-headers-type.yaml new file mode 100644 index 0000000000..d68a1e4904 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-message-binding-headers-type.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + messageBindings: + bindings1: + anypointmq: + headers: 123 + bindingVersion: '0.0.1' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-0-0-1.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-0-0-1.yaml new file mode 100644 index 0000000000..53d27443e5 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-0-0-1.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + operationBindings: + bindings1: + anypointmq: + foo: bar + bindingVersion: '0.0.1' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-0-1-0.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-0-1-0.yaml new file mode 100644 index 0000000000..6cbaabf47c --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-0-1-0.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + operationBindings: + bindings1: + anypointmq: + foo: bar + bindingVersion: '0.1.0' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-latest.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-latest.yaml new file mode 100644 index 0000000000..0fe868f0c3 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-operation-binding-allowed-fields-latest.yaml @@ -0,0 +1,9 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + operationBindings: + bindings1: + anypointmq: + foo: bar diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-0-0-1.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-0-0-1.yaml new file mode 100644 index 0000000000..ddc71815c3 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-0-0-1.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + serverBindings: + bindings1: + anypointmq: + foo: bar + bindingVersion: '0.0.1' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-0-1-0.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-0-1-0.yaml new file mode 100644 index 0000000000..ef5fd0a7f5 --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-0-1-0.yaml @@ -0,0 +1,10 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + serverBindings: + bindings1: + anypointmq: + foo: bar + bindingVersion: '0.1.0' diff --git a/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-latest.yaml b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-latest.yaml new file mode 100644 index 0000000000..5b2cdb099a --- /dev/null +++ b/packages/apidom-ls/test/fixtures/validation/asyncapi/bindings/anypointmq/anypointmq-server-binding-allowed-fields-latest.yaml @@ -0,0 +1,9 @@ +asyncapi: 3.0.0 +info: + title: Sample AsyncAPI + version: '1.0.0' +components: + serverBindings: + bindings1: + anypointmq: + foo: bar