diff --git a/packages/apidom-ls/scripts/transform-spec-fragment.js b/packages/apidom-ls/scripts/transform-spec-fragment.js new file mode 100644 index 0000000000..b55aa0a7cb --- /dev/null +++ b/packages/apidom-ls/scripts/transform-spec-fragment.js @@ -0,0 +1,41 @@ +/** + * Before using transform function please use + * this tool https://markdown-it.github.io/ to verify how your Markdown renders. + */ + +const transform = (str) => { + console.log(JSON.stringify(str.trim().replace(/(\r\n|\n|\r)/gm, '\n'))); +}; + +transform( + `#### Servers Object + +The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject). + +##### Patterned Fields + +Field Pattern | Type | Description +---|:---:|--- +\`^[A-Za-z0-9_\\-]+$\` | [Server Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject) | The definition of a server this application MAY connect to. + +##### Servers Object Example + +\`\`\`json +{ + "production": { + "url": "development.gigantic-server.com", + "description": "Development server", + "protocol": "kafka", + "protocolVersion": "1.0.0" + } +} +\`\`\` + +\`\`\`yaml +production: + url: development.gigantic-server.com + description: Development server + protocol: kafka + protocolVersion: '1.0.0' +\`\`\``, +); diff --git a/packages/apidom-ls/src/config/asyncapi/asyncapi2/complete/asyncapi2.ts b/packages/apidom-ls/src/config/asyncapi/asyncapi2/complete/asyncapi2.ts index d77b51c5a1..489ca35e37 100644 --- a/packages/apidom-ls/src/config/asyncapi/asyncapi2/complete/asyncapi2.ts +++ b/packages/apidom-ls/src/config/asyncapi/asyncapi2/complete/asyncapi2.ts @@ -28,7 +28,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'The version string signifies the version of the AsyncAPI Specification that the document complies to. The format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.\n\n ---- \n\nA `major`.`minor` shall be used to designate the AsyncAPI Specification version, and will be considered compatible with the AsyncAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `1.0.0` and `1.0.1`.\n\n ---- \n\nIn subsequent versions of the AsyncAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `1.1.0` specification should be usable with tooling designed for `1.0.0`.\n\n', + 'The version string signifies the version of the AsyncAPI Specification that the document complies to.\nThe format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.\n\\\n\\\nA `major`.`minor` shall be used to designate the AsyncAPI Specification version, and will be considered compatible with the AsyncAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `1.0.0` and `1.0.1`.\n\\\n\\\nIn subsequent versions of the AsyncAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `1.1.0` specification should be usable with tooling designed for `1.0.0`.', }, }, { @@ -41,7 +41,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\n ---- \n\nIt is **RECOMMENDED** to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', + 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\\\n\\\nIt is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', }, }, { @@ -54,7 +54,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - "A string representing the default content type to use when encoding/decoding a message's payload. The value **MUST** be a specific media type (e.g. `application/json`). This value **MUST** be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectContentType) property is omitted.", + "A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectContentType) property is omitted.\n\\\n\\\nIn case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.", }, }, { @@ -67,7 +67,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, }, { @@ -80,7 +80,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).', + 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, }, { @@ -119,7 +119,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '#### External Documentation Object\n\n ---- \n\nnAllows referencing an external resource for extended documentation.\n\n ---- \n\n##### Fixed Fields\n\n ---- \n\n**description** (`string`) : A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\n\n ---- \n\n**url** (`string`) : **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '#### External Documentation Object\n\\\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nurl | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### External Documentation Object Example\n\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```', }, }, { diff --git a/packages/apidom-ls/src/config/asyncapi/asyncapi2/docs/asyncapi2.ts b/packages/apidom-ls/src/config/asyncapi/asyncapi2/docs/asyncapi2.ts index 907414c07e..212bc0cbd3 100644 --- a/packages/apidom-ls/src/config/asyncapi/asyncapi2/docs/asyncapi2.ts +++ b/packages/apidom-ls/src/config/asyncapi/asyncapi2/docs/asyncapi2.ts @@ -1,11 +1,11 @@ const asyncapi2Docs = [ { target: 'asyncapi', - docs: 'The version string signifies the version of the AsyncAPI Specification that the document complies to. The format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.\n\n ---- \n\nA `major`.`minor` shall be used to designate the AsyncAPI Specification version, and will be considered compatible with the AsyncAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `1.0.0` and `1.0.1`.\n\n ---- \n\nIn subsequent versions of the AsyncAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `1.1.0` specification should be usable with tooling designed for `1.0.0`.\n\n', + docs: 'The version string signifies the version of the AsyncAPI Specification that the document complies to.\nThe format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.\n\\\n\\\nA `major`.`minor` shall be used to designate the AsyncAPI Specification version, and will be considered compatible with the AsyncAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `1.0.0` and `1.0.1`.\n\\\n\\\nIn subsequent versions of the AsyncAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `1.1.0` specification should be usable with tooling designed for `1.0.0`.', }, { target: 'id', - docs: 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\n ---- \n\nIt is **RECOMMENDED** to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', + docs: 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\\\n\\\nIt is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', }, { target: 'info', @@ -13,15 +13,15 @@ const asyncapi2Docs = [ }, { target: 'servers', - docs: 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).', + docs: 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, { target: 'defaultContentType', - docs: "A string representing the default content type to use when encoding/decoding a message's payload. The value **MUST** be a specific media type (e.g. `application/json`). This value **MUST** be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectContentType) property is omitted.", + docs: "A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectContentType) property is omitted.\n\\\n\\\nIn case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.", }, { target: 'channels', - docs: 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + docs: 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, { target: 'components', @@ -31,5 +31,9 @@ const asyncapi2Docs = [ target: 'tags', docs: 'A list of tags used by the specification with additional metadata. Each tag name in the list **MUST** be unique.', }, + { + target: 'externalDocs', + docs: 'Additional external documentation.', + }, ]; export default asyncapi2Docs; diff --git a/packages/apidom-ls/src/config/asyncapi/channel-item/complete/channel-item.ts b/packages/apidom-ls/src/config/asyncapi/channel-item/complete/channel-item.ts index 4ba40cb5d7..e0e8c09d86 100644 --- a/packages/apidom-ls/src/config/asyncapi/channel-item/complete/channel-item.ts +++ b/packages/apidom-ls/src/config/asyncapi/channel-item/complete/channel-item.ts @@ -15,7 +15,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - "Allows for an external definition of this channel item.\n\n ---- \n\nThe referenced structure **MUST** be in the format of a [Channel Item Object](https://www.asyncapi.com/docs/specifications/v2.2.0#channelItemObject). \n\n ---- \n\nIf there are conflicts between the referenced definition and this Channel Item's definition, the behavior is _undefined_.", + "Allows for an external definition of this channel item. The referenced structure MUST be in the format of a [Channel Item Object](https://www.asyncapi.com/docs/specifications/v2.3.0#channelItemObject). If there are conflicts between the referenced definition and this Channel Item's definition, the behavior is *undefined*.\n\\\n\\\n**Deprecated:** Usage of the `$ref` property has been deprecated.", }, }, { @@ -41,7 +41,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'The servers on which this channel is available, specified as an optional unordered list of names (string keys) of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject) defined in the [Servers Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serversObject) (a map). If `servers` is absent or empty then this channel must be available on all servers defined in the [Servers Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serversObject).', + 'The servers on which this channel is available, specified as an optional unordered list of names (string keys) of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject) defined in the [Servers Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serversObject) (a map). If `servers` is absent or empty then this channel must be available on all servers defined in the [Servers Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serversObject).', }, }, { @@ -54,7 +54,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Operation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationObject)\n\n ---- \n\nA definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.', + '#### [Operation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationObject)\nA definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.', }, }, { @@ -67,7 +67,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Operation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationObject)\n\n ---- \n\nA definition of the PUBLISH operation, which defines the messages consumed by the application from the channel.', + '#### [Operation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationObject)\nA definition of the PUBLISH operation, which defines the messages consumed by the application from the channel.', }, }, { @@ -80,7 +80,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Parameters Object](https://www.asyncapi.com/docs/specifications/v2.2.0#parametersObject)\n\n ---- \n\nA map of the parameters included in the channel name. It **SHOULD** be present only when using channels with expressions (as defined by [RFC 6570 section 2.2](https://tools.ietf.org/html/rfc6570#section-2.2)).', + '#### [Parameters Object](https://www.asyncapi.com/docs/specifications/v2.3.0#parametersObject)\nA map of the parameters included in the channel name. It SHOULD be present only when using channels with expressions (as defined by [RFC 6570 section 2.2](https://tools.ietf.org/html/rfc6570#section-2.2)).', }, }, { @@ -93,7 +93,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Channel Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#channelBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the channel.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '#### [Channel Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#channelBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the channel.', }, }, { diff --git a/packages/apidom-ls/src/config/asyncapi/channel-item/docs/channel-item.ts b/packages/apidom-ls/src/config/asyncapi/channel-item/docs/channel-item.ts index 0b0bd454ca..4eeb1cde47 100644 --- a/packages/apidom-ls/src/config/asyncapi/channel-item/docs/channel-item.ts +++ b/packages/apidom-ls/src/config/asyncapi/channel-item/docs/channel-item.ts @@ -1,7 +1,7 @@ const channelDocs = [ { target: '$ref', - docs: "Allows for an external definition of this channel item.\n\n ---- \n\nThe referenced structure **MUST** be in the format of a [Channel Item Object](https://www.asyncapi.com/docs/specifications/v2.2.0#channelItemObject). \n\n ---- \n\nIf there are conflicts between the referenced definition and this Channel Item's definition, the behavior is _undefined_.", + docs: "Allows for an external definition of this channel item. The referenced structure MUST be in the format of a [Channel Item Object](https://www.asyncapi.com/docs/specifications/v2.3.0#parametersObject#channelItemObject). If there are conflicts between the referenced definition and this Channel Item's definition, the behavior is *undefined*.\\n\\\\\\n\\\\\\n**Deprecated:** Usage of the `$ref` property has been deprecated.", }, { target: 'description', @@ -9,26 +9,26 @@ const channelDocs = [ }, { target: 'servers', - docs: 'The servers on which this channel is available, specified as an optional unordered list of names (string keys) of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject) defined in the [Servers Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serversObject) (a map). If `servers` is absent or empty then this channel must be available on all servers defined in the [Servers Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serversObject).', + docs: 'The servers on which this channel is available, specified as an optional unordered list of names (string keys) of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject) defined in the [Servers Object](https://www.asyncapi.com/docs/specifications/v2.3.0https://www.asyncapi.com/docs/specifications/v2.3.0#serversObject) (a map). If `servers` is absent or empty then this channel must be available on all servers defined in the [Servers Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serversObject).', }, { target: 'subscribe', - docs: '[Operation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationObject)\n\n ---- \n\nA definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.\n\n ---- \n\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received. For example, an operation might describe a chat application use case where a user sends a text message to a group.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n[operationId](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectOperationId) | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\n[summary](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectSummary) | `string` | A short summary of what the operation is about.\n[description](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectDescription) | `string` | A verbose explanation of the operation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.\n[tags](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTags) | [Tags Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\n[externalDocs](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectExternalDocs) | [External Documentation Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#externalDocumentationObject) | Additional external documentation for this operation.\n[bindings](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectBindings) | [Operation Bindings Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationBindingsObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\n[traits](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTraits) | [[Operation Trait Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationTraitObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\n[message](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectMessage) | [[Message Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#messageObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject)] | A definition of the message that will be published or received on this channel. `oneOf` is allowed here to specify multiple messages, however, **a message MUST be valid only against one of the referenced message objects.**\n\nThis object can be extended with [Specification Extensions](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n },\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```\n', + docs: '[Operation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationObject)\n\\\n\\\nA definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.\n\\\n\\\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.\n\\\n\\\nFor example, an operation might describe a chat application use case where a user sends a text message to a group. A publish operation describes messages that are received by the chat application, whereas a subscribe operation describes messages that are sent by the chat application.\n\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\noperationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\nsummary | `string` | A short summary of what the operation is about.\ndescription | `string` | A verbose explanation of the operation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\ntags | [Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\nexternalDocs | [External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject) | Additional external documentation for this operation.\nbindings | [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\ntraits | [[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\nmessage | [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | Map["oneOf", [[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]] | A definition of the message that will be published or received by this operation. Map containing a single `oneOf` key is allowed here to specify multiple messages. However, **a message MUST be valid only against one of the message objects.**\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n }\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```', }, { target: 'publish', - docs: '[Operation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationObject)\n\n ---- \n\nA definition of the PUBLISH operation, which defines the messages consumed by the application from the channel.\n\n ---- \n\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received. For example, an operation might describe a chat application use case where a user sends a text message to a group.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n[operationId](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectOperationId) | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\n[summary](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectSummary) | `string` | A short summary of what the operation is about.\n[description](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectDescription) | `string` | A verbose explanation of the operation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.\n[tags](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTags) | [Tags Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\n[externalDocs](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectExternalDocs) | [External Documentation Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#externalDocumentationObject) | Additional external documentation for this operation.\n[bindings](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectBindings) | [Operation Bindings Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationBindingsObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\n[traits](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTraits) | [[Operation Trait Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationTraitObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\n[message](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectMessage) | [[Message Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#messageObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject)] | A definition of the message that will be published or received on this channel. `oneOf` is allowed here to specify multiple messages, however, **a message MUST be valid only against one of the referenced message objects.**\n\nThis object can be extended with [Specification Extensions](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n },\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```\n', + docs: '[Operation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationObject)\n\\\n\\\nA definition of the PUBLISH operation, which defines the messages consumed by the application from the channel.\n\\\n\\\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.\n\\\n\\\nFor example, an operation might describe a chat application use case where a user sends a text message to a group. A publish operation describes messages that are received by the chat application, whereas a subscribe operation describes messages that are sent by the chat application.\n\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\noperationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\nsummary | `string` | A short summary of what the operation is about.\ndescription | `string` | A verbose explanation of the operation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\ntags | [Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\nexternalDocs | [External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject) | Additional external documentation for this operation.\nbindings | [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\ntraits | [[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\nmessage | [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | Map["oneOf", [[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]] | A definition of the message that will be published or received by this operation. Map containing a single `oneOf` key is allowed here to specify multiple messages. However, **a message MUST be valid only against one of the message objects.**\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n }\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```', }, { target: 'parameters', - docs: '[Parameters Object](https://www.asyncapi.com/docs/specifications/v2.2.0#parametersObject)\n\n ---- \n\nA map of the parameters included in the channel name. It **SHOULD** be present only when using channels with expressions (as defined by [RFC 6570 section 2.2](https://tools.ietf.org/html/rfc6570#section-2.2)).', + docs: '[Parameters Object](https://www.asyncapi.com/docs/specifications/v2.3.0#parametersObject)\n\\\n\\\nA map of the parameters included in the channel name. It **SHOULD** be present only when using channels with expressions (as defined by [RFC 6570 section 2.2](https://tools.ietf.org/html/rfc6570#section-2.2)).', }, { target: 'bindings', - docs: '[Channel Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#channelBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the channel.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: '[Channel Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#channelBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the channel.', }, { - docs: 'Describes the operations available on a single channel.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: 'Describes the operations available on a single channel.\n\\\n\\\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).', }, ]; export default channelDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/channels/docs/channels.ts b/packages/apidom-ls/src/config/asyncapi/channels/docs/channels.ts index d0f3db89f0..7a0813bcf6 100644 --- a/packages/apidom-ls/src/config/asyncapi/channels/docs/channels.ts +++ b/packages/apidom-ls/src/config/asyncapi/channels/docs/channels.ts @@ -1,6 +1,6 @@ const channelsDocs = [ { - docs: 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + docs: 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, ]; export default channelsDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/components/complete/components.ts b/packages/apidom-ls/src/config/asyncapi/components/complete/components.ts index cb91979dd7..039e7277ae 100644 --- a/packages/apidom-ls/src/config/asyncapi/components/complete/components.ts +++ b/packages/apidom-ls/src/config/asyncapi/components/complete/components.ts @@ -15,9 +15,37 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Schema Object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Schema Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject).', + 'Map[`string`, [Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Schema Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject).', }, }, + { + label: 'servers', + insertText: 'servers', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'Map[`string`, [Server Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', + }, + targetSpecs: [{ namespace: 'asyncapi', version: '2.3.0' }], + }, + { + label: 'channels', + insertText: 'channels', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'Map[`string`, [Server Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', + }, + targetSpecs: [{ namespace: 'asyncapi', version: '2.3.0' }], + }, { label: 'messages', insertText: 'messages', @@ -28,7 +56,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Message Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Message Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject).', + 'Map[`string`, [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Message Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject).', }, }, { @@ -41,7 +69,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Security Scheme Object](https://www.asyncapi.com/docs/specifications/v2.2.0#securitySchemeObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Security Scheme Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#securitySchemeObject).', + 'Map[`string`, [Security Scheme Object](https://www.asyncapi.com/docs/specifications/v2.3.0#securitySchemeObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Security Scheme Object](https://www.asyncapi.com/docs/specifications/v2.3.0#securitySchemeObject).', }, }, { @@ -54,7 +82,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Parameter Object](https://www.asyncapi.com/docs/specifications/v2.2.0#parameterObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Parameter Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#parameterObject).', + 'Map[`string`, [Parameter Object](https://www.asyncapi.com/docs/specifications/v2.3.0#parameterObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Parameter Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#parameterObject).', }, }, { @@ -67,7 +95,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Correlation ID Object](https://www.asyncapi.com/docs/specifications/v2.2.0#correlationIdObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Correlation ID Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#correlationIdObject).', + 'Map[`string`, [Correlation ID Object](https://www.asyncapi.com/docs/specifications/v2.3.0#correlationIdObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Correlation ID Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#correlationIdObject).', }, }, { @@ -80,7 +108,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Operation Trait Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#operationTraitObject).', + 'Map[`string`, [Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Operation Trait Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject).', }, }, { @@ -93,7 +121,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Message Trait Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Message Trait Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#messageTraitObject).', + 'Map[`string`, [Message Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Message Trait Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#messageTraitObject).', }, }, { @@ -106,7 +134,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serverBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Server Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverBindingsObject).', + 'Map[`string`, [Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Server Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverBindingsObject).', }, }, { @@ -119,7 +147,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Channel Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#channelBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Channel Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#channelBindingsObject).', + 'Map[`string`, [Channel Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#channelBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Channel Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#channelBindingsObject).', }, }, { @@ -132,7 +160,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Operation Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#operationBindingsObject).', + 'Map[`string`, [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Operation Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject).', }, }, { @@ -145,7 +173,7 @@ const componentsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Map[`string`, [Message Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Message Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#messageBindingsObject).', + 'Map[`string`, [Message Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Message Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#messageBindingsObject).', }, }, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/components/docs/components.ts b/packages/apidom-ls/src/config/asyncapi/components/docs/components.ts index 5b15be9ad8..80bbe17b18 100644 --- a/packages/apidom-ls/src/config/asyncapi/components/docs/components.ts +++ b/packages/apidom-ls/src/config/asyncapi/components/docs/components.ts @@ -1,50 +1,58 @@ const componentsDocs = [ { target: 'schemas', - docs: 'Map[`string`, [Schema Object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Schema Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject).', + docs: 'Map[`string`, [Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Schema Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject).', + }, + { + target: 'servers', + docs: 'Map[`string`, [Server Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', + }, + { + target: 'channels', + docs: 'Map[`string`, [Server Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, { target: 'messages', - docs: 'Map[`string`, [Message Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Message Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject).', + docs: 'Map[`string`, [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Message Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject).', }, { target: 'securitySchemes', - docs: 'Map[`string`, [Security Scheme Object](https://www.asyncapi.com/docs/specifications/v2.2.0#securitySchemeObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Security Scheme Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#securitySchemeObject).', + docs: 'Map[`string`, [Security Scheme Object](https://www.asyncapi.com/docs/specifications/v2.3.0#securitySchemeObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Security Scheme Object](https://www.asyncapi.com/docs/specifications/v2.3.0#securitySchemeObject).', }, { target: 'parameters', - docs: 'Map[`string`, [Parameter Object](https://www.asyncapi.com/docs/specifications/v2.2.0#parameterObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Parameter Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#parameterObject).', + docs: 'Map[`string`, [Parameter Object](https://www.asyncapi.com/docs/specifications/v2.3.0#parameterObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Parameter Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#parameterObject).', }, { target: 'correlationIds', - docs: 'Map[`string`, [Correlation ID Object](https://www.asyncapi.com/docs/specifications/v2.2.0#correlationIdObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Correlation ID Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#correlationIdObject).', + docs: 'Map[`string`, [Correlation ID Object](https://www.asyncapi.com/docs/specifications/v2.3.0#correlationIdObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Correlation ID Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#correlationIdObject).', }, { target: 'operationTraits', - docs: 'Map[`string`, [Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Operation Trait Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#operationTraitObject).', + docs: 'Map[`string`, [Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Operation Trait Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject).', }, { target: 'messageTraits', - docs: 'Map[`string`, [Message Trait Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Message Trait Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#messageTraitObject).', + docs: 'Map[`string`, [Message Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Message Trait Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#messageTraitObject).', }, { target: 'serverBindings', - docs: 'Map[`string`, [Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serverBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Server Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverBindingsObject).', + docs: 'Map[`string`, [Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Server Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverBindingsObject).', }, { target: 'channelBindings', - docs: 'Map[`string`, [Channel Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#channelBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Channel Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#channelBindingsObject).', + docs: 'Map[`string`, [Channel Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#channelBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Channel Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#channelBindingsObject).', }, { target: 'operationBindings', - docs: 'Map[`string`, [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Operation Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#operationBindingsObject).', + docs: 'Map[`string`, [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Operation Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject).', }, { target: 'messageBindings', - docs: 'Map[`string`, [Message Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nAn object to hold reusable [Message Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#messageBindingsObject).', + docs: 'Map[`string`, [Message Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nAn object to hold reusable [Message Bindings Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#messageBindingsObject).', }, { - docs: '[Components Object](https://www.asyncapi.com/docs/specifications/v2.2.0#componentsObject)\n\n ---- \n\nHolds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.', + docs: '[Components Object](https://www.asyncapi.com/docs/specifications/v2.3.0#componentsObject)\n\\\n\\\nHolds a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.', }, ]; export default componentsDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/config.ts b/packages/apidom-ls/src/config/asyncapi/config.ts index aed60431be..848fe9b85f 100644 --- a/packages/apidom-ls/src/config/asyncapi/config.ts +++ b/packages/apidom-ls/src/config/asyncapi/config.ts @@ -25,6 +25,11 @@ import messageMeta from './message/meta'; import componentsMeta from './components/meta'; import ApilintCodes from '../codes'; +/** + * Keys in this object represents either element type names + * or value of one of the meta classes. + */ + export default { '*': { lint: [ diff --git a/packages/apidom-ls/src/config/asyncapi/external-documentation/complete/externaldocs.ts b/packages/apidom-ls/src/config/asyncapi/external-documentation/complete/externaldocs.ts index 606e760080..77fee98736 100644 --- a/packages/apidom-ls/src/config/asyncapi/external-documentation/complete/externaldocs.ts +++ b/packages/apidom-ls/src/config/asyncapi/external-documentation/complete/externaldocs.ts @@ -15,7 +15,7 @@ const externalDocsCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '**Required**. The URL for the target documentation. Value **MUST** be in the format of a URL.', + '**Required.** The URL for the target documentation. Value MUST be in the format of a URL.', }, }, { @@ -28,7 +28,7 @@ const externalDocsCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '**Required**. The URL for the target documentation. Value **MUST** be in the format of a URL.', + 'A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.', }, }, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/external-documentation/docs/externaldocs.ts b/packages/apidom-ls/src/config/asyncapi/external-documentation/docs/externaldocs.ts index 2726ad5417..8e59d673ed 100644 --- a/packages/apidom-ls/src/config/asyncapi/external-documentation/docs/externaldocs.ts +++ b/packages/apidom-ls/src/config/asyncapi/external-documentation/docs/externaldocs.ts @@ -1,6 +1,6 @@ const externalDocsDocs = [ { - docs: '#### External Documentation Object\n\n ---- \n\nnAllows referencing an external resource for extended documentation.\n\n ---- \n\n##### Fixed Fields\n\n ---- \n\n**description** (`string`) : A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\n\n ---- \n\n**url** (`string`) : **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: '#### External Documentation Object\n\\\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nurl | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### External Documentation Object Example\n\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```', }, { target: 'url', diff --git a/packages/apidom-ls/src/config/asyncapi/http-message-binding/complete/http-message-binding.ts b/packages/apidom-ls/src/config/asyncapi/http-message-binding/complete/http-message-binding.ts index 788d4d5c1e..bb6109e3ff 100644 --- a/packages/apidom-ls/src/config/asyncapi/http-message-binding/complete/http-message-binding.ts +++ b/packages/apidom-ls/src/config/asyncapi/http-message-binding/complete/http-message-binding.ts @@ -15,7 +15,7 @@ const httpMessageBindingCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Schema object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject)\n\n ---- \n\nA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type `object` and have a `properties` key.', + '[Schema object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject)\n\\\n\\\nA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type `object` and have a `properties` key.', }, }, { diff --git a/packages/apidom-ls/src/config/asyncapi/http-message-binding/docs/http-message-binding.ts b/packages/apidom-ls/src/config/asyncapi/http-message-binding/docs/http-message-binding.ts index a19dea0f0d..b3336fc43c 100644 --- a/packages/apidom-ls/src/config/asyncapi/http-message-binding/docs/http-message-binding.ts +++ b/packages/apidom-ls/src/config/asyncapi/http-message-binding/docs/http-message-binding.ts @@ -1,7 +1,7 @@ const httpMessageBindingDocs = [ { target: 'headers', - docs: '[Schema object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject)\n\n ---- \n\nA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type `object` and have a `properties` key.', + docs: '[Schema object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject)\n\\\n\\\nA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type `object` and have a `properties` key.', }, { target: 'bindingVersion', diff --git a/packages/apidom-ls/src/config/asyncapi/kafka-message-binding/complete/kafka-message-binding.ts b/packages/apidom-ls/src/config/asyncapi/kafka-message-binding/complete/kafka-message-binding.ts index 4152e3b8bc..5e6f25c093 100644 --- a/packages/apidom-ls/src/config/asyncapi/kafka-message-binding/complete/kafka-message-binding.ts +++ b/packages/apidom-ls/src/config/asyncapi/kafka-message-binding/complete/kafka-message-binding.ts @@ -15,7 +15,7 @@ const kafkaMessageBindingCompleteJson: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Schema Object][schemaObject] \\| [AVRO Schema Object](https://avro.apache.org/docs/current/spec.html) | The message key. **NOTE**: You can also use the [reference object](https://asyncapi.io/docs/specifications/v2.1.0#referenceObject) way.', + '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) \\| [AVRO Schema Object](https://avro.apache.org/docs/current/spec.html)\n\\\n\\\n The message key. **NOTE**: You can also use the [reference object](https://asyncapi.io/docs/specifications/v2.3.0#referenceObject) way.', }, }, { diff --git a/packages/apidom-ls/src/config/asyncapi/kafka-message-binding/docs/kafka-message-binding.ts b/packages/apidom-ls/src/config/asyncapi/kafka-message-binding/docs/kafka-message-binding.ts index a3fbefb656..98a8b0bbf7 100644 --- a/packages/apidom-ls/src/config/asyncapi/kafka-message-binding/docs/kafka-message-binding.ts +++ b/packages/apidom-ls/src/config/asyncapi/kafka-message-binding/docs/kafka-message-binding.ts @@ -1,7 +1,7 @@ const kafkaMessageBindingDocs = [ { target: 'key', - docs: '[Schema Object][schemaObject] \\| [AVRO Schema Object](https://avro.apache.org/docs/current/spec.html) | The message key. **NOTE**: You can also use the [reference object](https://asyncapi.io/docs/specifications/v2.1.0#referenceObject) way.', + docs: '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) \\| [AVRO Schema Object](https://avro.apache.org/docs/current/spec.html)\n\\\n\\\n The message key. **NOTE**: You can also use the [reference object](https://asyncapi.io/docs/specifications/v2.3.0#referenceObject) way.', }, { target: 'bindingVersion', diff --git a/packages/apidom-ls/src/config/asyncapi/message-bindings/complete/message-bindings.ts b/packages/apidom-ls/src/config/asyncapi/message-bindings/complete/message-bindings.ts index 93e37d2a6c..b233a52da6 100644 --- a/packages/apidom-ls/src/config/asyncapi/message-bindings/complete/message-bindings.ts +++ b/packages/apidom-ls/src/config/asyncapi/message-bindings/complete/message-bindings.ts @@ -27,7 +27,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[HTTP Message Binding](https://github.com/asyncapi/bindings/blob/master/http#message)\n\n ---- \n\nProtocol-specific information for an HTTP message.', + '[HTTP Message Binding](https://github.com/asyncapi/bindings/blob/master/http#message)\n\\\n\\\nProtocol-specific information for an HTTP message.', }, }, { @@ -40,7 +40,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[WebSockets Message Binding](https://github.com/asyncapi/bindings/blob/master/websockets#message)\n\n ---- \n\nProtocol-specific information for a WebSockets message.', + '[WebSockets Message Binding](https://github.com/asyncapi/bindings/blob/master/websockets#message)\n\\\n\\\nProtocol-specific information for a WebSockets message.', }, }, { @@ -53,7 +53,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Kafka Message Binding](https://github.com/asyncapi/bindings/blob/master/kafka#message)\n\n ---- \n\nProtocol-specific information for a Kafka message.', + '[Kafka Message Binding](https://github.com/asyncapi/bindings/blob/master/kafka#message)\n\\\n\\\nProtocol-specific information for a Kafka message.', }, }, { @@ -66,9 +66,12 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Anypoint MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#message)\n\n ---- \n\nProtocol-specific information for an Anypoint MQ message.\n', + '[Anypoint MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#message)\n\\\n\\\nProtocol-specific information for an Anypoint MQ message.', }, - targetSpecs: [{ namespace: 'asyncapi', version: '2.2.0' }], + targetSpecs: [ + { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, + ], }, { label: 'amqp', @@ -80,7 +83,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[AMQP Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp#message)\n\n ---- \n\nProtocol-specific information for an AMQP 0-9-1 message.', + '[AMQP Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp#message)\n\\\n\\\nProtocol-specific information for an AMQP 0-9-1 message.', }, }, { @@ -93,7 +96,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[AMQP 1.0 Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#message)\n\n ---- \n\nProtocol-specific information for an AMQP 1.0 message.', + '[AMQP 1.0 Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#message)\n\\\n\\\nProtocol-specific information for an AMQP 1.0 message.', }, }, { @@ -106,7 +109,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[MQTT Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#message)\n\n ---- \n\nProtocol-specific information for an MQTT message.', + '[MQTT Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#message)\n\\\n\\\nProtocol-specific information for an MQTT message.', }, }, { @@ -119,7 +122,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[MQTT 5 Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#message)\n\n ---- \n\nProtocol-specific information for an MQTT 5 message.', + '[MQTT 5 Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#message)\n\\\n\\\nProtocol-specific information for an MQTT 5 message.', }, }, { @@ -132,7 +135,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[NATS Message Binding](https://github.com/asyncapi/bindings/blob/master/nats#message)\n\n ---- \n\nProtocol-specific information for a NATS message.', + '[NATS Message Binding](https://github.com/asyncapi/bindings/blob/master/nats#message)\n\\\n\\\nProtocol-specific information for a NATS message.', }, }, { @@ -145,7 +148,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[JMS Message Binding](https://github.com/asyncapi/bindings/blob/master/jms#message)\n\n ---- \n\nProtocol-specific information for a JMS message.', + '[JMS Message Binding](https://github.com/asyncapi/bindings/blob/master/jms#message)\n\\\n\\\nProtocol-specific information for a JMS message.', }, }, { @@ -158,8 +161,22 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[SNS Message Binding](https://github.com/asyncapi/bindings/blob/master/sns#message)\n\n ---- \n\nProtocol-specific information for an SNS message.', + '[SNS Message Binding](https://github.com/asyncapi/bindings/blob/master/sns#message)\n\\\n\\\nProtocol-specific information for an SNS message.', + }, + }, + { + label: 'solace', + insertText: 'solace', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Solace Message Binding](https://github.com/asyncapi/bindings/blob/master/solace#message)\n\\\n\\\nProtocol-specific information for a Solace message.', }, + targetSpecs: [{ namespace: 'asyncapi', version: '2.3.0' }], }, { label: 'sqs', @@ -171,7 +188,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[SQS Message Binding](https://github.com/asyncapi/bindings/blob/master/sqs#message)\n\n ---- \n\nProtocol-specific information for an SQS message.', + '[SQS Message Binding](https://github.com/asyncapi/bindings/blob/master/sqs#message)\n\\\n\\\nProtocol-specific information for an SQS message.', }, }, { @@ -184,7 +201,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[STOMP Message Binding](https://github.com/asyncapi/bindings/blob/master/stomp#message)\n\n ---- \n\nProtocol-specific information for a STOMP message.', + '[STOMP Message Binding](https://github.com/asyncapi/bindings/blob/master/stomp#message)\n\\\n\\\nProtocol-specific information for a STOMP message.', }, }, { @@ -197,7 +214,7 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Redis Message Binding](https://github.com/asyncapi/bindings/blob/master/redis#message)\n\n ---- \n\nProtocol-specific information for a Redis message.', + '[Redis Message Binding](https://github.com/asyncapi/bindings/blob/master/redis#message)\n\\\n\\\nProtocol-specific information for a Redis message.', }, }, { @@ -210,11 +227,12 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Mercure Message Binding](https://github.com/asyncapi/bindings/blob/master/mercure#message)\n\n ---- \n\nProtocol-specific information for a Mercure message.', + '[Mercure Message Binding](https://github.com/asyncapi/bindings/blob/master/mercure#message)\n\\\n\\\nProtocol-specific information for a Mercure message.', }, targetSpecs: [ { namespace: 'asyncapi', version: '2.1.0' }, { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, ], }, { @@ -227,11 +245,12 @@ const messageBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[IBM MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/ibmmq#message-binding-object)\n\n ---- \n\nProtocol-specific information for an IBM MQ message.', + '[IBM MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/ibmmq#message-binding-object)\n\\\n\\\nProtocol-specific information for an IBM MQ message.', }, targetSpecs: [ { namespace: 'asyncapi', version: '2.1.0' }, { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, ], }, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/message-bindings/docs/message-bindings.ts b/packages/apidom-ls/src/config/asyncapi/message-bindings/docs/message-bindings.ts index 7642b0d980..f2258eff83 100644 --- a/packages/apidom-ls/src/config/asyncapi/message-bindings/docs/message-bindings.ts +++ b/packages/apidom-ls/src/config/asyncapi/message-bindings/docs/message-bindings.ts @@ -5,67 +5,71 @@ const messageBindingsDocs = [ }, { target: 'http', - docs: '[HTTP Message Binding](https://github.com/asyncapi/bindings/blob/master/http#message)\n\n ---- \n\nProtocol-specific information for an HTTP message.', + docs: '[HTTP Message Binding](https://github.com/asyncapi/bindings/blob/master/http#message)\n\\\n\\\nProtocol-specific information for an HTTP message.', }, { target: 'ws', - docs: '[WebSockets Message Binding](https://github.com/asyncapi/bindings/blob/master/websockets#message)\n\n ---- \n\nProtocol-specific information for a WebSockets message.', + docs: '[WebSockets Message Binding](https://github.com/asyncapi/bindings/blob/master/websockets#message)\n\\\n\\\nProtocol-specific information for a WebSockets message.', }, { target: 'kafka', - docs: '[Kafka Message Binding](https://github.com/asyncapi/bindings/blob/master/kafka#message)\n\n ---- \n\nProtocol-specific information for a Kafka message.', + docs: '[Kafka Message Binding](https://github.com/asyncapi/bindings/blob/master/kafka#message)\n\\\n\\\nProtocol-specific information for a Kafka message.', }, { target: 'anypointmq', - docs: '[Anypoint MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#message)\n\n ---- \n\nProtocol-specific information for an Anypoint MQ message.', + docs: '[Anypoint MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#message)\n\\\n\\\nProtocol-specific information for an Anypoint MQ message.', }, { target: 'amqp', - docs: '[AMQP Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp#message)\n\n ---- \n\nProtocol-specific information for an AMQP 0-9-1 message.', + docs: '[AMQP Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp#message)\n\\\n\\\nProtocol-specific information for an AMQP 0-9-1 message.', }, { target: 'amqp1', - docs: '[AMQP 1.0 Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#message)\n\n ---- \n\nProtocol-specific information for an AMQP 1.0 message.', + docs: '[AMQP 1.0 Message Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#message)\n\\\n\\\nProtocol-specific information for an AMQP 1.0 message.', }, { target: 'mqtt', - docs: '[MQTT Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#message)\n\n ---- \n\nProtocol-specific information for an MQTT message.', + docs: '[MQTT Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#message)\n\\\n\\\nProtocol-specific information for an MQTT message.', }, { target: 'mqtt5', - docs: '[MQTT 5 Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#message)\n\n ---- \n\nProtocol-specific information for an MQTT 5 message.', + docs: '[MQTT 5 Message Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#message)\n\\\n\\\nProtocol-specific information for an MQTT 5 message.', }, { target: 'nats', - docs: '[NATS Message Binding](https://github.com/asyncapi/bindings/blob/master/nats#message)\n\n ---- \n\nProtocol-specific information for a NATS message.', + docs: '[NATS Message Binding](https://github.com/asyncapi/bindings/blob/master/nats#message)\n\\\n\\\nProtocol-specific information for a NATS message.', }, { target: 'jms', - docs: '[JMS Message Binding](https://github.com/asyncapi/bindings/blob/master/jms#message)\n\n ---- \n\nProtocol-specific information for a JMS message.', + docs: '[JMS Message Binding](https://github.com/asyncapi/bindings/blob/master/jms#message)\n\\\n\\\nProtocol-specific information for a JMS message.', }, { target: 'sns', - docs: '[SNS Message Binding](https://github.com/asyncapi/bindings/blob/master/sns#message)\n\n ---- \n\nProtocol-specific information for an SNS message.', + docs: '[SNS Message Binding](https://github.com/asyncapi/bindings/blob/master/sns#message)\n\\\n\\\nProtocol-specific information for an SNS message.', + }, + { + target: 'solace', + docs: '[Solace Message Binding](https://github.com/asyncapi/bindings/blob/master/solace#message)\n\\\n\\\nProtocol-specific information for a Solace message.', }, { target: 'sqs', - docs: '[SQS Message Binding](https://github.com/asyncapi/bindings/blob/master/sqs#message)\n\n ---- \n\nProtocol-specific information for an SQS message.', + docs: '[SQS Message Binding](https://github.com/asyncapi/bindings/blob/master/sqs#message)\n\\\n\\\nProtocol-specific information for an SQS message.', }, { target: 'stomp', - docs: '[STOMP Message Binding](https://github.com/asyncapi/bindings/blob/master/stomp#message)\n\n ---- \n\nProtocol-specific information for a STOMP message.', + docs: '[STOMP Message Binding](https://github.com/asyncapi/bindings/blob/master/stomp#message)\n\\\n\\\nProtocol-specific information for a STOMP message.', }, { target: 'redis', - docs: '[Redis Message Binding](https://github.com/asyncapi/bindings/blob/master/redis#message)\n\n ---- \n\nProtocol-specific information for a Redis message.', + docs: '[Redis Message Binding](https://github.com/asyncapi/bindings/blob/master/redis#message)\n\\\n\\\nProtocol-specific information for a Redis message.', }, { target: 'mercure', - docs: '[Mercure Message Binding](https://github.com/asyncapi/bindings/blob/master/mercure#message)\n\n ---- \n\nProtocol-specific information for a Mercure message.', + docs: '[Mercure Message Binding](https://github.com/asyncapi/bindings/blob/master/mercure#message)\n\\\n\\\nProtocol-specific information for a Mercure message.', }, { target: 'ibmmq', - docs: '[IBM MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/ibmmq#message-binding-object)\n\n ---- \n\nProtocol-specific information for an IBM MQ message.', + docs: '[IBM MQ Message Binding](https://github.com/asyncapi/bindings/blob/master/ibmmq#message-binding-object)\n\\\n\\\nProtocol-specific information for an IBM MQ message.', }, ]; export default messageBindingsDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/message/complete/message.ts b/packages/apidom-ls/src/config/asyncapi/message/complete/message.ts index 5e89f5cde3..642adca194 100644 --- a/packages/apidom-ls/src/config/asyncapi/message/complete/message.ts +++ b/packages/apidom-ls/src/config/asyncapi/message/complete/message.ts @@ -27,7 +27,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ----\n\nSchema definition of the application headers. Schema MUST be of type "object". It **MUST NOT** define the protocol headers.', + '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) \\\n\\\nSchema definition of the application headers. Schema MUST be of type "object". It **MUST NOT** define the protocol headers.', }, }, { @@ -40,7 +40,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Definition of the message payload. It can be of any type but defaults to [Schema object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject). It must match the schema format, including encoding type - e.g Avro should be inlined as either a YAML or JSON object NOT a string to be parsed as YAML or JSON.', + 'Definition of the message payload. It can be of any type but defaults to [Schema object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject). It must match the schema format, including encoding type - e.g Avro should be inlined as either a YAML or JSON object NOT a string to be parsed as YAML or JSON.', }, }, { @@ -53,7 +53,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Correlation ID Object](https://www.asyncapi.com/docs/specifications/v2.2.0#correlationIdObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nDefinition of the correlation ID used for message tracing or matching.', + '[Correlation ID Object](https://www.asyncapi.com/docs/specifications/v2.3.0#correlationIdObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nDefinition of the correlation ID used for message tracing or matching.', }, }, { @@ -66,8 +66,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'A string containing the name of the schema format used to define the message payload. If omitted, implementations should parse the payload as a [Schema object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject). When the payload is defined using a `$ref` to a remote file, it is RECOMMENDED the schema format includes the file encoding type to allow implementations to parse the file correctly. E.g., adding `+yaml` if content type is `application/vnd.apache.avro` results in `application/vnd.apache.avro+yaml`. \n' + - '\n\n ---- \n\nCheck out the [supported schema formats table](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectSchemaFormatTable) for more information. Custom values are allowed but their implementation is OPTIONAL. A custom value MUST NOT refer to one of the schema formats listed in the [table](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectSchemaFormatTable).', + 'A string containing the name of the schema format used to define the message payload. If omitted, implementations should parse the payload as a [Schema object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject). When the payload is defined using a `$ref` to a remote file, it is RECOMMENDED the schema format includes the file encoding type to allow implementations to parse the file correctly. E.g., adding `+yaml` if content type is `application/vnd.apache.avro` results in `application/vnd.apache.avro+yaml`.\n\\\n\\\nCheck out the [supported schema formats table](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectSchemaFormatTable) for more information. Custom values are allowed but their implementation is OPTIONAL. A custom value MUST NOT refer to one of the schema formats listed in the [table](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectSchemaFormatTable).', }, }, { @@ -80,7 +79,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). When omitted, the value MUST be the one specified on the [defaultContentType](https://www.asyncapi.com/docs/specifications/v2.2.0#defaultContentTypeString) field.", + "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). When omitted, the value MUST be the one specified on the [defaultContentType](https://www.asyncapi.com/docs/specifications/v2.3.0#defaultContentTypeString) field.", }, }, { @@ -142,7 +141,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Tags Object](https://www.asyncapi.com/docs/specifications/v2.2.0#tagsObject)\n\n ---- \n\nA list of tags for API documentation control.', + '[Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#tagsObject)\n\\\n\\\nA list of tags for API documentation control. Tags can be used for logical grouping of messages.', }, }, { @@ -155,7 +154,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#externalDocumentationObject)\n\n ---- \n\nAdditional external documentation for this message..', + '[External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this message.', }, }, { @@ -168,7 +167,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Message Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message.', + '[Message Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message.', }, }, { @@ -181,7 +180,7 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '\\[[Message Example Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageExampleObject)\\]\n\n ---- \n\nList of examples.', + '[[Message Example Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageExampleObject)\\]\n\\\n\\\nList of examples.', }, }, { @@ -194,9 +193,39 @@ const messageComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[[Message Trait Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nA list of traits to apply to the message object. Traits MUST be merged into the message object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here. The resulting object MUST be a valid [Message Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject).\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '[[Message Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nA list of traits to apply to the message object. Traits MUST be merged into the message object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here. The resulting object MUST be a valid [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject).', }, }, + { + target: 'schemaFormat', + label: 'application/vnd.aai.asyncapi;version=2.3.0', + insertText: 'application/vnd.aai.asyncapi;version=2.3.0', + kind: 12, + format: CompletionFormat.QUOTED, + type: CompletionType.VALUE, + insertTextFormat: 2, + targetSpecs: [{ namespace: 'asyncapi', version: '2.3.0' }], + }, + { + target: 'schemaFormat', + label: 'application/vnd.aai.asyncapi+json;version=2.3.0', + insertText: 'application/vnd.aai.asyncapi+json;version=2.3.0', + kind: 12, + format: CompletionFormat.QUOTED, + type: CompletionType.VALUE, + insertTextFormat: 2, + targetSpecs: [{ namespace: 'asyncapi', version: '2.3.0' }], + }, + { + target: 'schemaFormat', + label: 'application/vnd.aai.asyncapi+yaml;version=2.3.0', + insertText: 'application/vnd.aai.asyncapi+yaml;version=2.3.0', + kind: 12, + format: CompletionFormat.QUOTED, + type: CompletionType.VALUE, + insertTextFormat: 2, + targetSpecs: [{ namespace: 'asyncapi', version: '2.3.0' }], + }, { target: 'schemaFormat', label: 'application/vnd.aai.asyncapi;version=2.2.0', diff --git a/packages/apidom-ls/src/config/asyncapi/message/docs/message.ts b/packages/apidom-ls/src/config/asyncapi/message/docs/message.ts index 838aeed22e..ffa1ac671f 100644 --- a/packages/apidom-ls/src/config/asyncapi/message/docs/message.ts +++ b/packages/apidom-ls/src/config/asyncapi/message/docs/message.ts @@ -1,25 +1,23 @@ const messageDocs = [ { target: 'headers', - docs: '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ----\n\nSchema definition of the application headers. Schema MUST be of type "object". It **MUST NOT** define the protocol headers.', + docs: '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) \\\n\\\nSchema definition of the application headers. Schema MUST be of type "object". It **MUST NOT** define the protocol headers.', }, { target: 'payload', - docs: 'Definition of the message payload. It can be of any type but defaults to [Schema object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject). It must match the schema format, including encoding type - e.g Avro should be inlined as either a YAML or JSON object NOT a string to be parsed as YAML or JSON.', + docs: 'Definition of the message payload. It can be of any type but defaults to [Schema object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject). It must match the schema format, including encoding type - e.g Avro should be inlined as either a YAML or JSON object NOT a string to be parsed as YAML or JSON.', }, { target: 'correlationId', - docs: '[Correlation ID Object](https://www.asyncapi.com/docs/specifications/v2.2.0#correlationIdObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nDefinition of the correlation ID used for message tracing or matching.', + docs: '[Correlation ID Object](https://www.asyncapi.com/docs/specifications/v2.3.0#correlationIdObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nDefinition of the correlation ID used for message tracing or matching.', }, { target: 'schemaFormat', - docs: - 'A string containing the name of the schema format used to define the message payload. If omitted, implementations should parse the payload as a [Schema object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject). When the payload is defined using a `$ref` to a remote file, it is RECOMMENDED the schema format includes the file encoding type to allow implementations to parse the file correctly. E.g., adding `+yaml` if content type is `application/vnd.apache.avro` results in `application/vnd.apache.avro+yaml`. \n' + - '\n\n ---- \n\nCheck out the [supported schema formats table](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectSchemaFormatTable) for more information. Custom values are allowed but their implementation is OPTIONAL. A custom value MUST NOT refer to one of the schema formats listed in the [table](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectSchemaFormatTable).', + docs: 'A string containing the name of the schema format used to define the message payload. If omitted, implementations should parse the payload as a [Schema object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject). When the payload is defined using a `$ref` to a remote file, it is RECOMMENDED the schema format includes the file encoding type to allow implementations to parse the file correctly. E.g., adding `+yaml` if content type is `application/vnd.apache.avro` results in `application/vnd.apache.avro+yaml`.\n\\\n\\\nCheck out the [supported schema formats table](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectSchemaFormatTable) for more information. Custom values are allowed but their implementation is OPTIONAL. A custom value MUST NOT refer to one of the schema formats listed in the [table](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectSchemaFormatTable).', }, { target: 'contentType', - docs: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). When omitted, the value MUST be the one specified on the [defaultContentType](https://www.asyncapi.com/docs/specifications/v2.2.0#defaultContentTypeString) field.", + docs: "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). When omitted, the value MUST be the one specified on the [defaultContentType](https://www.asyncapi.com/docs/specifications/v2.3.0#defaultContentTypeString) field.", }, { target: 'name', @@ -39,26 +37,26 @@ const messageDocs = [ }, { target: 'tags', - docs: '[Tags Object](https://www.asyncapi.com/docs/specifications/v2.2.0#tagsObject)\n\n ---- \n\nA list of tags for API documentation control.', + docs: '[Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#tagsObject)\n\\\n\\\nA list of tags for API documentation control. Tags can be used for logical grouping of messages.', }, { target: 'externalDocs', - docs: '[External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#externalDocumentationObject)\n\n ---- \n\nAdditional external documentation for this message..', + docs: '[External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this message.', }, { target: 'bindings', - docs: '[Message Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message.', + docs: '[Message Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the message.', }, { target: 'examples', - docs: '\\[[Message Example Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageExampleObject)\\]\n\n ---- \n\nList of examples.', + docs: '[[Message Example Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageExampleObject)\\]\n\\\n\\\nList of examples.', }, { target: 'traits', - docs: '[[Message Trait Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nA list of traits to apply to the message object. Traits MUST be merged into the message object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here. The resulting object MUST be a valid [Message Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject).\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: '[[Message Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]\n\\\n\\\nA list of traits to apply to the message object. Traits MUST be merged into the message object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here. The resulting object MUST be a valid [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject).', }, { - docs: '[Message Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject)\\n\\n ---- \\n\\nDescribes a message received on a given channel and operation.\\n\\n ---- \\n\\nA message is the mechanism by which information is exchanged via a channel between servers and applications. A message MUST contain a payload and MAY also contain headers. The headers MAY be subdivided into protocol-defined headers and header properties defined by the application which can act as supporting metadata. The payload contains the data, defined by the application, which MUST be serialized into a format (JSON, XML, Avro, binary, etc.). Since a message is a generic mechanism, it can support multiple interaction patterns such as event, command, request, or response.', + docs: '#### Message Object\n\nDescribes a message received on a given channel and operation.\n\\\n\\\nA message is the mechanism by which information is exchanged via a channel between servers and applications. A message MUST contain a payload and MAY also contain headers. The headers MAY be subdivided into [protocol](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsProtocol)-defined headers and header properties defined by the application which can act as supporting metadata. The payload contains the data, defined by the application, which MUST be serialized into a format (JSON, XML, Avro, binary, etc.). Since a message is a generic mechanism, it can support multiple interaction patterns such as event, command, request, or response.', }, ]; export default messageDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/operation/complete/operation.ts b/packages/apidom-ls/src/config/asyncapi/operation/complete/operation.ts index 40b89fb6c8..656dc22cd7 100644 --- a/packages/apidom-ls/src/config/asyncapi/operation/complete/operation.ts +++ b/packages/apidom-ls/src/config/asyncapi/operation/complete/operation.ts @@ -15,7 +15,7 @@ const operationComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'Unique string used to identify the operation. The id **MUST** be unique among all operations described in the API. The operationId value is **case-sensitive**.\n\n ----\n\nTools and libraries **MAY** use the operationId to uniquely identify an operation, therefore, it is **RECOMMENDED** to follow common programming naming conventions.', + 'Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.', }, }, { @@ -53,7 +53,7 @@ const operationComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'A list of tags for API documentation control. Tags can be used for logical grouping of operations.', + '[Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageBindingsObject#tagsObject)\n\\\n\\\nA list of tags for API documentation control. Tags can be used for logical grouping of operations.', }, }, { @@ -66,7 +66,7 @@ const operationComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#externalDocumentationObject)\n\n ---- \n\nAdditional external documentation for this operation..', + '[External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this operation.', }, }, { @@ -79,13 +79,13 @@ const operationComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '[Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.', }, }, { target: 'bindings', - label: 'amqp', - insertText: 'amqp', + label: 'http', + insertText: 'http', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -93,8 +93,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'amqps', - insertText: 'amqps', + label: 'ws', + insertText: 'ws', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -102,8 +102,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'http', - insertText: 'http', + label: 'kafka', + insertText: 'kafka', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -111,8 +111,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'https', - insertText: 'https', + label: 'anypointmq', + insertText: 'anypointmq', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -120,8 +120,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'ibmmq', - insertText: 'ibmmq', + label: 'amqp', + insertText: 'amqp', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -129,8 +129,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'jms', - insertText: 'jms', + label: 'amqp1', + insertText: 'amqp1', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -138,8 +138,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'kafka', - insertText: 'kafka', + label: 'mqtt', + insertText: 'mqtt', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -147,8 +147,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'kafka-secure', - insertText: 'kafka-secure', + label: 'mqtt5', + insertText: 'mqtt5', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -156,8 +156,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'anypointmq', - insertText: 'anypointmq', + label: 'nats', + insertText: 'nats', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -165,8 +165,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'mqtt', - insertText: 'mqtt', + label: 'jms', + insertText: 'jms', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -174,8 +174,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'secure-mqtt', - insertText: 'secure-mqtt', + label: 'sns', + insertText: 'sns', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -183,8 +183,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'stomp', - insertText: 'stomp', + label: 'solace', + insertText: 'solace', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -192,8 +192,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'stomps', - insertText: 'stomps', + label: 'sqs', + insertText: 'sqs', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -201,8 +201,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'ws', - insertText: 'ws', + label: 'stomp', + insertText: 'stomp', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -210,8 +210,8 @@ const operationComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'wss', - insertText: 'wss', + label: 'redis', + insertText: 'redis', kind: 14, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -236,7 +236,7 @@ const operationComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject) ]\n\n ---- \n\nA list of traits to apply to the operation object. Traits **MUST** be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.', + '[[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) ]\n\\\n\\\nA list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.', }, }, { @@ -249,7 +249,7 @@ const operationComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[[Message Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nA definition of the message that will be published or received on this channel. `oneOf` is allowed here to specify multiple messages, however, **a message MUST be valid only against one of the referenced message objects.**\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | Map["oneOf", [[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]]\n\\\n\\\nA definition of the message that will be published or received by this operation. Map containing a single `oneOf` key is allowed here to specify multiple messages. However, **a message MUST be valid only against one of the message objects.**', }, }, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/operation/docs/operation.ts b/packages/apidom-ls/src/config/asyncapi/operation/docs/operation.ts index c64b350897..91203d42fb 100644 --- a/packages/apidom-ls/src/config/asyncapi/operation/docs/operation.ts +++ b/packages/apidom-ls/src/config/asyncapi/operation/docs/operation.ts @@ -1,7 +1,7 @@ const operationDocs = [ { target: 'operationId', - docs: 'Unique string used to identify the operation. The id **MUST** be unique among all operations described in the API. The operationId value is **case-sensitive**.\n\n ----\n\nTools and libraries **MAY** use the operationId to uniquely identify an operation, therefore, it is **RECOMMENDED** to follow common programming naming conventions.', + docs: 'Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.', }, { target: 'summary', @@ -13,26 +13,26 @@ const operationDocs = [ }, { target: 'tags', - docs: 'A list of tags for API documentation control. Tags can be used for logical grouping of operations.', + docs: '[Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageBindingsObject#tagsObject)\n\\\n\\\nA list of tags for API documentation control. Tags can be used for logical grouping of operations.', }, { target: 'externalDocs', - docs: '[External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#externalDocumentationObject)\n\n ---- \n\nAdditional external documentation for this operation..', + docs: '[External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this operation.', }, { target: 'bindings', - docs: '[Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: '[Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.', }, { target: 'traits', - docs: '[[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject) ]\n\n ---- \n\nA list of traits to apply to the operation object. Traits **MUST** be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.', + docs: '[[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) ]\n\\\n\\\nA list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.', }, { target: 'message', - docs: '[[Message Object](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)]\n\n ---- \n\nA definition of the message that will be published or received on this channel. `oneOf` is allowed here to specify multiple messages, however, **a message MUST be valid only against one of the referenced message objects.**\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: '[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | Map["oneOf", [[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]]\n\\\n\\\nA definition of the message that will be published or received by this operation. Map containing a single `oneOf` key is allowed here to specify multiple messages. However, **a message MUST be valid only against one of the message objects.**', }, { - docs: 'https://github.com/asyncapi/asyncapi/blob/master/versions/2.2.0/asyncapi.md#operationObject\n\n#### Operation Object\n\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received. For example, an operation might describe a chat application use case where a user sends a text message to a group.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n[operationId](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectOperationId) | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\n[summary](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectSummary) | `string` | A short summary of what the operation is about.\n[description](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectDescription) | `string` | A verbose explanation of the operation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.\n[tags](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTags) | [Tags Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\n[externalDocs](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectExternalDocs) | [External Documentation Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#externalDocumentationObject) | Additional external documentation for this operation.\n[bindings](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectBindings) | [Operation Bindings Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationBindingsObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\n[traits](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTraits) | [[Operation Trait Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationTraitObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\n[message](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectMessage) | [[Message Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#messageObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject)] | A definition of the message that will be published or received on this channel. `oneOf` is allowed here to specify multiple messages, however, **a message MUST be valid only against one of the referenced message objects.**\n\nThis object can be extended with [Specification Extensions](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n },\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```\n', + docs: '#### Operation Object\n\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.\n\\\n\\\nFor example, an operation might describe a chat application use case where a user sends a text message to a group. A publish operation describes messages that are received by the chat application, whereas a subscribe operation describes messages that are sent by the chat application.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\noperationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\nsummary | `string` | A short summary of what the operation is about.\ndescription | `string` | A verbose explanation of the operation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\ntags | [Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\nexternalDocs | [External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject) | Additional external documentation for this operation.\nbindings | [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\ntraits | [[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\nmessage | [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | Map["oneOf", [[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]] | A definition of the message that will be published or received by this operation. Map containing a single `oneOf` key is allowed here to specify multiple messages. However, **a message MUST be valid only against one of the message objects.**\n\n\\\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n }\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```', }, ]; export default operationDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/parameter/complete/parameter.ts b/packages/apidom-ls/src/config/asyncapi/parameter/complete/parameter.ts index 4b1a2fb9e7..fb3c99c0a8 100644 --- a/packages/apidom-ls/src/config/asyncapi/parameter/complete/parameter.ts +++ b/packages/apidom-ls/src/config/asyncapi/parameter/complete/parameter.ts @@ -28,7 +28,7 @@ const parameterComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nDefinition of the parameter.', + '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nDefinition of the parameter.', }, }, { @@ -41,7 +41,7 @@ const parameterComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - 'A [runtime expression](https://www.asyncapi.com/docs/specifications/v2.2.0#runtimeExpression) that specifies the location of the parameter value. Even when a definition for the target field exists, it **MUST NOT** be used to validate this parameter but, instead, the `schema` property **MUST** be used.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + 'A [runtime expression](https://www.asyncapi.com/docs/specifications/v2.3.0#runtimeExpression) that specifies the location of the parameter value. Even when a definition for the target field exists, it MUST NOT be used to validate this parameter but, instead, the `schema` property MUST be used.', }, }, { diff --git a/packages/apidom-ls/src/config/asyncapi/parameter/docs/parameter.ts b/packages/apidom-ls/src/config/asyncapi/parameter/docs/parameter.ts index af843c1b33..f3835f2a84 100644 --- a/packages/apidom-ls/src/config/asyncapi/parameter/docs/parameter.ts +++ b/packages/apidom-ls/src/config/asyncapi/parameter/docs/parameter.ts @@ -5,15 +5,18 @@ const parameterDocs = [ }, { target: 'location', - docs: 'A [runtime expression](https://www.asyncapi.com/docs/specifications/v2.2.0#runtimeExpression) that specifies the location of the parameter value. Even when a definition for the target field exists, it **MUST NOT** be used to validate this parameter but, instead, the `schema` property **MUST** be used.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: 'A [runtime expression](https://www.asyncapi.com/docs/specifications/v2.3.0#runtimeExpression) that specifies the location of the parameter value. Even when a definition for the target field exists, it MUST NOT be used to validate this parameter but, instead, the `schema` property MUST be used.', }, { target: 'schema', - docs: '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.2.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nDefinition of the parameter.', + docs: '[Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nDefinition of the parameter.', }, { target: '$ref', docs: 'A reference to a parameter.', }, + { + docs: '#### Parameter Object\n\nDescribes a parameter included in a channel name.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A verbose explanation of the parameter. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nschema | [Schema Object](https://www.asyncapi.com/docs/specifications/v2.3.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | Definition of the parameter.\nlocation | `string` | A [runtime expression](https://www.asyncapi.com/docs/specifications/v2.3.0#runtimeExpression) that specifies the location of the parameter value. Even when a definition for the target field exists, it MUST NOT be used to validate this parameter but, instead, the `schema` property MUST be used.\n\n\\\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### Parameter Object Example\n\n```json\n{\n "user/{userId}/signup": {\n "parameters": {\n "userId": {\n "description": "Id of the user.",\n "schema": {\n "type": "string"\n },\n "location": "$message.payload#/user/id"\n }\n },\n "subscribe": {\n "message": {\n "$ref": "#/components/messages/userSignedUp"\n }\n }\n }\n}\n```\n\n```yaml\nuser/{userId}/signup:\n parameters:\n userId:\n description: Id of the user.\n schema:\n type: string\n location: $message.payload#/user/id\n subscribe:\n message:\n $ref: "#/components/messages/userSignedUp"\n```', + }, ]; export default parameterDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/securityscheme/complete/securityscheme.ts b/packages/apidom-ls/src/config/asyncapi/securityscheme/complete/securityscheme.ts index 4ae907b1d8..1e35cb0277 100644 --- a/packages/apidom-ls/src/config/asyncapi/securityscheme/complete/securityscheme.ts +++ b/packages/apidom-ls/src/config/asyncapi/securityscheme/complete/securityscheme.ts @@ -87,10 +87,6 @@ const securitySchemeTypeComplete: ApidomCompletionItem[] = [ insertTextFormat: 2, }, { - targetSpecs: [ - { namespace: 'asyncapi', version: '2.1.0' }, - { namespace: 'asyncapi', version: '2.2.0' }, - ], target: 'type', label: 'plain', insertText: 'plain', @@ -98,12 +94,13 @@ const securitySchemeTypeComplete: ApidomCompletionItem[] = [ format: CompletionFormat.QUOTED, type: CompletionType.VALUE, insertTextFormat: 2, - }, - { targetSpecs: [ { namespace: 'asyncapi', version: '2.1.0' }, { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, ], + }, + { target: 'type', label: 'scramSha256', insertText: 'scramSha256', @@ -111,12 +108,13 @@ const securitySchemeTypeComplete: ApidomCompletionItem[] = [ format: CompletionFormat.QUOTED, type: CompletionType.VALUE, insertTextFormat: 2, - }, - { targetSpecs: [ { namespace: 'asyncapi', version: '2.1.0' }, { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, ], + }, + { target: 'type', label: 'scramSha512', insertText: 'scramSha512', @@ -124,12 +122,13 @@ const securitySchemeTypeComplete: ApidomCompletionItem[] = [ format: CompletionFormat.QUOTED, type: CompletionType.VALUE, insertTextFormat: 2, - }, - { targetSpecs: [ { namespace: 'asyncapi', version: '2.1.0' }, { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, ], + }, + { target: 'type', label: 'gssapi', insertText: 'gssapi', @@ -137,6 +136,11 @@ const securitySchemeTypeComplete: ApidomCompletionItem[] = [ format: CompletionFormat.QUOTED, type: CompletionType.VALUE, insertTextFormat: 2, + targetSpecs: [ + { namespace: 'asyncapi', version: '2.1.0' }, + { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, + ], }, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/securityscheme/lint/lints.ts b/packages/apidom-ls/src/config/asyncapi/securityscheme/lint/lints.ts index 14dc0ca36b..abd6facd3b 100644 --- a/packages/apidom-ls/src/config/asyncapi/securityscheme/lint/lints.ts +++ b/packages/apidom-ls/src/config/asyncapi/securityscheme/lint/lints.ts @@ -1,6 +1,6 @@ import securitySchemeTypeLint20 from './type20'; -import securitySchemeTypeLint2122 from './type2122'; +import securitySchemeTypeLint2123 from './type21-23'; -const securitySchemeLints = [securitySchemeTypeLint20, securitySchemeTypeLint2122]; +const securitySchemeLints = [securitySchemeTypeLint20, securitySchemeTypeLint2123]; export default securitySchemeLints; diff --git a/packages/apidom-ls/src/config/asyncapi/securityscheme/lint/type2122.ts b/packages/apidom-ls/src/config/asyncapi/securityscheme/lint/type21-23.ts similarity index 98% rename from packages/apidom-ls/src/config/asyncapi/securityscheme/lint/type2122.ts rename to packages/apidom-ls/src/config/asyncapi/securityscheme/lint/type21-23.ts index 766b163c55..782d4963f8 100644 --- a/packages/apidom-ls/src/config/asyncapi/securityscheme/lint/type2122.ts +++ b/packages/apidom-ls/src/config/asyncapi/securityscheme/lint/type21-23.ts @@ -7,6 +7,7 @@ const securitySchemeTypeLint2122: LinterMeta = { message: 'type must be one of allowed values', severity: 1, targetSpecs: [ + { namespace: 'asyncapi', version: '2.3.0' }, { namespace: 'asyncapi', version: '2.2.0' }, { namespace: 'asyncapi', version: '2.1.0' }, ], diff --git a/packages/apidom-ls/src/config/asyncapi/server-bindings/complete/server-bindings.ts b/packages/apidom-ls/src/config/asyncapi/server-bindings/complete/server-bindings.ts index 8e5326185c..b05a8be9a4 100644 --- a/packages/apidom-ls/src/config/asyncapi/server-bindings/complete/server-bindings.ts +++ b/packages/apidom-ls/src/config/asyncapi/server-bindings/complete/server-bindings.ts @@ -27,7 +27,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[HTTP Server Binding](https://github.com/asyncapi/bindings/blob/master/http#server)\n\n ---- \n\nProtocol-specific information for an HTTP server.', + '[HTTP Server Binding](https://github.com/asyncapi/bindings/blob/master/http#server)\n\\\n\\\nProtocol-specific information for an HTTP server.', }, }, { @@ -40,7 +40,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[WebSockets Server Binding](https://github.com/asyncapi/bindings/blob/master/websockets#server)\n\n ---- \n\nProtocol-specific information for a WebSockets server.', + '[WebSockets Server Binding](https://github.com/asyncapi/bindings/blob/master/websockets#server)\n\\\n\\\nProtocol-specific information for a WebSockets server.', }, }, { @@ -53,7 +53,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Kafka Server Binding](https://github.com/asyncapi/bindings/blob/master/kafka#server)\n\n ---- \n\nProtocol-specific information for a Kafka server.', + '[Kafka Server Binding](https://github.com/asyncapi/bindings/blob/master/kafka#server)\n\\\n\\\nProtocol-specific information for a Kafka server.', }, }, { @@ -66,9 +66,12 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Anypoint MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#server)\n\n ---- \n\nProtocol-specific information for an Anypoint MQ server.\n', + '[Anypoint MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#server)\n\\\n\\\nProtocol-specific information for an Anypoint MQ server.', }, - targetSpecs: [{ namespace: 'asyncapi', version: '2.2.0' }], + targetSpecs: [ + { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, + ], }, { label: 'amqp', @@ -80,7 +83,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[AMQP Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp#server)\n\n ---- \n\nProtocol-specific information for an AMQP 0-9-1 server.', + '[AMQP Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp#server)\n\\\n\\\nProtocol-specific information for an AMQP 0-9-1 server.', }, }, { @@ -93,7 +96,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[AMQP 1.0 Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#server)\n\n ---- \n\nProtocol-specific information for an AMQP 1.0 server.', + '[AMQP 1.0 Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#server)\n\\\n\\\nProtocol-specific information for an AMQP 1.0 server.', }, }, { @@ -106,7 +109,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[MQTT Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#server)\n\n ---- \n\nProtocol-specific information for an MQTT server.', + '[MQTT Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#server)\n\\\n\\\nProtocol-specific information for an MQTT server.', }, }, { @@ -119,7 +122,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[MQTT 5 Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#server)\n\n ---- \n\nProtocol-specific information for an MQTT 5 server.', + '[MQTT 5 Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#server)\n\\\n\\\nProtocol-specific information for an MQTT 5 server.', }, }, { @@ -132,7 +135,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[NATS Server Binding](https://github.com/asyncapi/bindings/blob/master/nats#server)\n\n ---- \n\nProtocol-specific information for a NATS server.', + '[NATS Server Binding](https://github.com/asyncapi/bindings/blob/master/nats#server)\n\\\n\\\nProtocol-specific information for a NATS server.', }, }, { @@ -145,7 +148,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[JMS Server Binding](https://github.com/asyncapi/bindings/blob/master/jms#server)\n\n ---- \n\nProtocol-specific information for a JMS server.', + '[JMS Server Binding](https://github.com/asyncapi/bindings/blob/master/jms#server)\n\\\n\\\nProtocol-specific information for a JMS server.', }, }, { @@ -158,8 +161,22 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[SNS Server Binding](https://github.com/asyncapi/bindings/blob/master/sns#server)\n\n ---- \n\nProtocol-specific information for an SNS server.', + '[SNS Server Binding](https://github.com/asyncapi/bindings/blob/master/sns#server)\n\\\n\\\nProtocol-specific information for an SNS server.', + }, + }, + { + label: 'solace', + insertText: 'solace', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Solace Server Binding](https://github.com/asyncapi/bindings/tree/master/solace#server-binding-object)\n\\\n\\\nProtocol-specific information for a Solace server.', }, + targetSpecs: [{ namespace: 'asyncapi', version: '2.3.0' }], }, { label: 'sqs', @@ -171,7 +188,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[SQS Server Binding](https://github.com/asyncapi/bindings/blob/master/sqs#server)\n\n ---- \n\nProtocol-specific information for an SQS server.', + '[SQS Server Binding](https://github.com/asyncapi/bindings/blob/master/sqs#server)\n\\\n\\\nProtocol-specific information for an SQS server.', }, }, { @@ -184,7 +201,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[STOMP Server Binding](https://github.com/asyncapi/bindings/blob/master/stomp#server)\n\n ---- \n\nProtocol-specific information for a STOMP server.', + '[STOMP Server Binding](https://github.com/asyncapi/bindings/blob/master/stomp#server)\n\\\n\\\nProtocol-specific information for a STOMP server.', }, }, { @@ -197,7 +214,7 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Redis Server Binding](https://github.com/asyncapi/bindings/blob/master/redis#server)\n\n ---- \n\nProtocol-specific information for a Redis server.', + '[Redis Server Binding](https://github.com/asyncapi/bindings/blob/master/redis#server)\n\\\n\\\nProtocol-specific information for a Redis server.', }, }, { @@ -210,11 +227,12 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Mercure Server Binding](https://github.com/asyncapi/bindings/blob/master/mercure#server)\n\n ---- \n\nProtocol-specific information for a Mercure server.', + '[Mercure Server Binding](https://github.com/asyncapi/bindings/blob/master/mercure#server)\n\\\n\\\nProtocol-specific information for a Mercure server.', }, targetSpecs: [ { namespace: 'asyncapi', version: '2.1.0' }, { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, ], }, { @@ -227,11 +245,12 @@ const serverBindingsComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[IBM MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/ibmmq#server-binding-object)\n\n ---- \n\nProtocol-specific information for an IBM MQ server.', + '[IBM MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/ibmmq#server-binding-object)\n\\\n\\\nProtocol-specific information for an IBM MQ server.', }, targetSpecs: [ { namespace: 'asyncapi', version: '2.1.0' }, { namespace: 'asyncapi', version: '2.2.0' }, + { namespace: 'asyncapi', version: '2.3.0' }, ], }, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/server-bindings/docs/server-bindings.ts b/packages/apidom-ls/src/config/asyncapi/server-bindings/docs/server-bindings.ts index 6740b465a7..7868ee6c7b 100644 --- a/packages/apidom-ls/src/config/asyncapi/server-bindings/docs/server-bindings.ts +++ b/packages/apidom-ls/src/config/asyncapi/server-bindings/docs/server-bindings.ts @@ -5,67 +5,74 @@ const serverBindingsDocs = [ }, { target: 'http', - docs: '[HTTP Server Binding](https://github.com/asyncapi/bindings/blob/master/http#server)\n\n ---- \n\nProtocol-specific information for an HTTP server.', + docs: '[HTTP Server Binding](https://github.com/asyncapi/bindings/blob/master/http#server)\n\\\n\\\nProtocol-specific information for an HTTP server.', }, { target: 'ws', - docs: '[WebSockets Server Binding](https://github.com/asyncapi/bindings/blob/master/websockets#server)\n\n ---- \n\nProtocol-specific information for a WebSockets server.', + docs: '[WebSockets Server Binding](https://github.com/asyncapi/bindings/blob/master/websockets#server)\n\\\n\\\nProtocol-specific information for a WebSockets server.', }, { target: 'kafka', - docs: '[Kafka Server Binding](https://github.com/asyncapi/bindings/blob/master/kafka#server)\n\n ---- \n\nProtocol-specific information for a Kafka server.', + docs: '[Kafka Server Binding](https://github.com/asyncapi/bindings/blob/master/kafka#server)\n\\\n\\\nProtocol-specific information for a Kafka server.', }, { target: 'anypointmq', - docs: '[Anypoint MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#server)\n\n ---- \n\nProtocol-specific information for an Anypoint MQ server.', + docs: '[Anypoint MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/anypointmq#server)\n\\\n\\\nProtocol-specific information for an Anypoint MQ server.', }, { target: 'amqp', - docs: '[AMQP Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp#server)\n\n ---- \n\nProtocol-specific information for an AMQP 0-9-1 server.', + docs: '[AMQP Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp#server)\n\\\n\\\nProtocol-specific information for an AMQP 0-9-1 server.', }, { target: 'amqp1', - docs: '[AMQP 1.0 Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#server)\n\n ---- \n\nProtocol-specific information for an AMQP 1.0 server.', + docs: '[AMQP 1.0 Server Binding](https://github.com/asyncapi/bindings/blob/master/amqp1#server)\n\\\n\\\nProtocol-specific information for an AMQP 1.0 server.', }, { target: 'mqtt', - docs: '[MQTT Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#server)\n\n ---- \n\nProtocol-specific information for an MQTT server.', + docs: '[MQTT Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt#server)\n\\\n\\\nProtocol-specific information for an MQTT server.', }, { target: 'mqtt5', - docs: '[MQTT 5 Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#server)\n\n ---- \n\nProtocol-specific information for an MQTT 5 server.', + docs: '[MQTT 5 Server Binding](https://github.com/asyncapi/bindings/blob/master/mqtt5#server)\n\\\n\\\nProtocol-specific information for an MQTT 5 server.', }, { target: 'nats', - docs: '[NATS Server Binding](https://github.com/asyncapi/bindings/blob/master/nats#server)\n\n ---- \n\nProtocol-specific information for a NATS server.', + docs: '[NATS Server Binding](https://github.com/asyncapi/bindings/blob/master/nats#server)\n\\\n\\\nProtocol-specific information for a NATS server.', }, { target: 'jms', - docs: '[JMS Server Binding](https://github.com/asyncapi/bindings/blob/master/jms#server)\n\n ---- \n\nProtocol-specific information for a JMS server.', + docs: '[JMS Server Binding](https://github.com/asyncapi/bindings/blob/master/jms#server)\n\\\n\\\nProtocol-specific information for a JMS server.', }, { target: 'sns', - docs: '[SNS Server Binding](https://github.com/asyncapi/bindings/blob/master/sns#server)\n\n ---- \n\nProtocol-specific information for an SNS server.', + docs: '[SNS Server Binding](https://github.com/asyncapi/bindings/blob/master/sns#server)\n\\\n\\\nProtocol-specific information for an SNS server.', + }, + { + target: 'solace', + docs: '[Solace Server Binding](https://github.com/asyncapi/bindings/tree/master/solace#server-binding-object)\n\\\n\\\nProtocol-specific information for a Solace server.', }, { target: 'sqs', - docs: '[SQS Server Binding](https://github.com/asyncapi/bindings/blob/master/sqs#server)\n\n ---- \n\nProtocol-specific information for an SQS server.', + docs: '[SQS Server Binding](https://github.com/asyncapi/bindings/blob/master/sqs#server)\n\\\n\\\nProtocol-specific information for an SQS server.', }, { target: 'stomp', - docs: '[STOMP Server Binding](https://github.com/asyncapi/bindings/blob/master/stomp#server)\n\n ---- \n\nProtocol-specific information for a STOMP server.', + docs: '[STOMP Server Binding](https://github.com/asyncapi/bindings/blob/master/stomp#server)\n\\\n\\\nProtocol-specific information for a STOMP server.', }, { target: 'redis', - docs: '[Redis Server Binding](https://github.com/asyncapi/bindings/blob/master/redis#server)\n\n ---- \n\nProtocol-specific information for a Redis server.', + docs: '[Redis Server Binding](https://github.com/asyncapi/bindings/blob/master/redis#server)\n\\\n\\\nProtocol-specific information for a Redis server.', }, { target: 'mercure', - docs: '[Mercure Server Binding](https://github.com/asyncapi/bindings/blob/master/mercure#server)\n\n ---- \n\nProtocol-specific information for a Mercure server.', + docs: '[Mercure Server Binding](https://github.com/asyncapi/bindings/blob/master/mercure#server)\n\\\n\\\nProtocol-specific information for a Mercure server.', }, { target: 'ibmmq', - docs: '[IBM MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/ibmmq#server-binding-object)\n\n ---- \n\nProtocol-specific information for an IBM MQ server.', + docs: '[IBM MQ Server Binding](https://github.com/asyncapi/bindings/blob/master/ibmmq#server-binding-object)\n\\\n\\\nProtocol-specific information for an IBM MQ server.', + }, + { + docs: 'Map describing protocol-specific definitions for a server.', }, ]; export default serverBindingsDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/server-variable/complete/server-variable.ts b/packages/apidom-ls/src/config/asyncapi/server-variable/complete/server-variable.ts index e1d8a1db47..2e3ba60a71 100644 --- a/packages/apidom-ls/src/config/asyncapi/server-variable/complete/server-variable.ts +++ b/packages/apidom-ls/src/config/asyncapi/server-variable/complete/server-variable.ts @@ -53,8 +53,7 @@ const serverVariableComplete: ApidomCompletionItem[] = [ insertTextFormat: 2, documentation: { kind: 'markdown', - value: - 'An array of examples of the server variable.\n\n ---- \n\nThis object **MAY** be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + value: 'An array of examples of the server variable.', }, }, ]; diff --git a/packages/apidom-ls/src/config/asyncapi/server-variable/docs/server-variable.ts b/packages/apidom-ls/src/config/asyncapi/server-variable/docs/server-variable.ts index add3033417..b988ca0beb 100644 --- a/packages/apidom-ls/src/config/asyncapi/server-variable/docs/server-variable.ts +++ b/packages/apidom-ls/src/config/asyncapi/server-variable/docs/server-variable.ts @@ -13,10 +13,10 @@ const serverVariableDocs = [ }, { target: 'examples', - docs: 'An array of examples of the server variable.\n\n ---- \n\nThis object **MAY** be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: 'An array of examples of the server variable.', }, { - docs: 'An object representing a Server Variable for server URL template substitution.\n\n ---- \n\nThis object **MAY** be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: 'An object representing a Server Variable for server URL template substitution.\n\\\n\\\nThis object **MAY** be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).', }, ]; export default serverVariableDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/server/complete/server.ts b/packages/apidom-ls/src/config/asyncapi/server/complete/server.ts index 5e9d9da330..0ec503db90 100644 --- a/packages/apidom-ls/src/config/asyncapi/server/complete/server.ts +++ b/packages/apidom-ls/src/config/asyncapi/server/complete/server.ts @@ -15,7 +15,7 @@ const serverComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '**REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.', + '**REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be made when a variable is named in `{`braces`}`.', }, }, { @@ -28,7 +28,7 @@ const serverComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '**REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `ibmmq`, `jms`, `kafka`, `kafka-secure`, `anypointmq`, `mqtt`, `secure-mqtt`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.', + '**REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `ibmmq`, `jms`, `kafka`, `kafka-secure`, `anypointmq`, `mqtt`, `secure-mqtt`, `solace`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.', }, }, { @@ -67,7 +67,7 @@ const serverComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - "Map[`string`, [Server Variable Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serverVariableObject)]\n\n ---- \n\nA map between a variable name and its value. The value is used for substitution in the server's URL template.", + "Map[`string`, [Server Variable Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverVariableObject)]\n\\\n\\\nA map between a variable name and its value. The value is used for substitution in the server's URL template.", }, }, { @@ -80,7 +80,7 @@ const serverComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[[Security Requirement Object](https://www.asyncapi.com/docs/specifications/v2.2.0#securityRequirementObject)]\n\n ---- \n\nA declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a connection or operation.', + '[[Security Requirement Object](https://www.asyncapi.com/docs/specifications/v2.3.0#securityRequirementObject)]\n\\\n\\\nA declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a connection or operation.', }, }, { @@ -93,7 +93,7 @@ const serverComplete: ApidomCompletionItem[] = [ documentation: { kind: 'markdown', value: - '[Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serverBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.\n\n ---- \n\nThis object **MAY** be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '[Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.', }, }, { @@ -195,6 +195,15 @@ const serverComplete: ApidomCompletionItem[] = [ type: CompletionType.VALUE, insertTextFormat: 2, }, + { + target: 'protocol', + label: 'solace', + insertText: 'solace', + kind: 12, + format: CompletionFormat.QUOTED, + type: CompletionType.VALUE, + insertTextFormat: 2, + }, { target: 'protocol', label: 'stomp', @@ -349,8 +358,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'amqp', - insertText: 'amqp', + label: 'http', + insertText: 'http', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -358,8 +367,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'amqps', - insertText: 'amqps', + label: 'ws', + insertText: 'ws', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -367,8 +376,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'http', - insertText: 'http', + label: 'kafka', + insertText: 'kafka', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -376,8 +385,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'https', - insertText: 'https', + label: 'anypointmq', + insertText: 'anypointmq', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -385,8 +394,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'ibmmq', - insertText: 'ibmmq', + label: 'amqp', + insertText: 'amqp', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -394,8 +403,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'jms', - insertText: 'jms', + label: 'amqp1', + insertText: 'amqp1', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -403,8 +412,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'kafka', - insertText: 'kafka', + label: 'mqtt', + insertText: 'mqtt', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -412,8 +421,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'kafka-secure', - insertText: 'kafka-secure', + label: 'mqtt5', + insertText: 'mqtt5', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -421,8 +430,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'anypointmq', - insertText: 'anypointmq', + label: 'nats', + insertText: 'nats', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -430,8 +439,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'mqtt', - insertText: 'mqtt', + label: 'jms', + insertText: 'jms', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -439,8 +448,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'secure-mqtt', - insertText: 'secure-mqtt', + label: 'sns', + insertText: 'sns', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -448,8 +457,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'stomp', - insertText: 'stomp', + label: 'solace', + insertText: 'solace', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -457,8 +466,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'stomps', - insertText: 'stomps', + label: 'sqs', + insertText: 'sqs', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -466,8 +475,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'ws', - insertText: 'ws', + label: 'stomps', + insertText: 'stomps', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -475,8 +484,8 @@ const serverComplete: ApidomCompletionItem[] = [ }, { target: 'bindings', - label: 'wss', - insertText: 'wss', + label: 'redis', + insertText: 'redis', kind: 12, format: CompletionFormat.OBJECT, type: CompletionType.PROPERTY, @@ -491,6 +500,15 @@ const serverComplete: ApidomCompletionItem[] = [ type: CompletionType.PROPERTY, insertTextFormat: 2, }, + { + target: 'bindings', + label: 'ibmmq', + insertText: 'ibmmq', + kind: 12, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + }, ]; export default serverComplete; diff --git a/packages/apidom-ls/src/config/asyncapi/server/docs/server.ts b/packages/apidom-ls/src/config/asyncapi/server/docs/server.ts index 174e813b05..191eaad1b0 100644 --- a/packages/apidom-ls/src/config/asyncapi/server/docs/server.ts +++ b/packages/apidom-ls/src/config/asyncapi/server/docs/server.ts @@ -1,11 +1,11 @@ const serverDocs = [ { target: 'url', - docs: '**REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.', + docs: '**REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be made when a variable is named in `{`braces`}`.', }, { target: 'protocol', - docs: '**REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `ibmmq`, `jms`, `kafka`, `kafka-secure`, `anypointmq`, `mqtt`, `secure-mqtt`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.', + docs: '**REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `ibmmq`, `jms`, `kafka`, `kafka-secure`, `anypointmq`, `mqtt`, `secure-mqtt`, `solace`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.', }, { target: 'protocolVersion', @@ -17,18 +17,18 @@ const serverDocs = [ }, { target: 'variables', - docs: "Map[`string`, [Server Variable Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serverVariableObject)]\n\n ---- \n\nA map between a variable name and its value. The value is used for substitution in the server's URL template.", + docs: "Map[`string`, [Server Variable Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverVariableObject)]\n\\\n\\\nA map between a variable name and its value. The value is used for substitution in the server's URL template.", }, { target: 'security', - docs: '[[Security Requirement Object](https://www.asyncapi.com/docs/specifications/v2.2.0#securityRequirementObject)]\n\n ---- \n\nA declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a connection or operation.', + docs: '[[Security Requirement Object](https://www.asyncapi.com/docs/specifications/v2.3.0#securityRequirementObject)]\n\\\n\\\nA declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a connection or operation.', }, { target: 'bindings', - docs: '[Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.2.0#serverBindingsObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.2.0#referenceObject)\n\n ---- \n\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.\n\n ---- \n\nThis object **MAY** be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + docs: '[Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)\n\\\n\\\nA map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.', }, { - docs: '#### Server Object\n\nAn object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data. This object is used to capture details such as URIs, protocols and security configuration. Variable substitution can be used so that some details, for example usernames and passwords, can be injected by code generation tools.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\nurl | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.\nprotocol | `string` | **REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `jms`, `kafka`, `kafka-secure`, `mqtt`, `secure-mqtt`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.\nprotocolVersion | `string` | The version of the protocol used for connection. For instance: AMQP `0.9.1`, HTTP `2.0`, Kafka `1.0.0`, etc.\ndescription | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.\nvariables | Map[`string`, [Server Variable Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#serverVariableObject)] | A map between a variable name and its value. The value is used for substitution in the server\'s URL template.\nsecurity | [[Security Requirement Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#securityRequirementObject)] | A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a connection or operation.\nbindings | [Server Bindings Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#serverBindingsObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.\n\nThis object MAY be extended with [Specification Extensions](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#specificationExtensions).\n\n##### Server Object Example\n\nA single server would be described as:\n\n```json\n{\n "url": "development.gigantic-server.com",\n "description": "Development server",\n "protocol": "kafka",\n "protocolVersion": "1.0.0"\n}\n```\n\n```yaml\nurl: development.gigantic-server.com\ndescription: Development server\nprotocol: kafka\nprotocolVersion: \'1.0.0\'\n```\n\nThe following shows how multiple servers can be described, for example, at the AsyncAPI Object\'s [`servers`](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#A2SServers):\n\n```json\n{\n "servers": {\n "development": {\n "url": "development.gigantic-server.com",\n "description": "Development server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n },\n "staging": {\n "url": "staging.gigantic-server.com",\n "description": "Staging server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n },\n "production": {\n "url": "api.gigantic-server.com",\n "description": "Production server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n }\n }\n}\n```\n\n```yaml\nservers:\n development:\n url: development.gigantic-server.com\n description: Development server\n protocol: amqp\n protocolVersion: 0.9.1\n staging:\n url: staging.gigantic-server.com\n description: Staging server\n protocol: amqp\n protocolVersion: 0.9.1\n production:\n url: api.gigantic-server.com\n description: Production server\n protocol: amqp\n protocolVersion: 0.9.1\n```\n\nThe following shows how variables can be used for a server configuration:\n\n```json\n{\n "servers": {\n "production": {\n "url": "{username}.gigantic-server.com:{port}/{basePath}",\n "description": "The production API server",\n "protocol": "secure-mqtt",\n "variables": {\n "username": {\n "default": "demo",\n "description": "This value is assigned by the service provider, in this example `gigantic-server.com`"\n },\n "port": {\n "enum": [\n "8883",\n "8884"\n ],\n "default": "8883"\n }\n }\n }\n }\n}\n```\n\n```yaml\nservers:\n production:\n url: \'{username}.gigantic-server.com:{port}/{basePath}\'\n description: The production API server\n protocol: secure-mqtt\n variables:\n username:\n # note! no enum here means it is an open value\n default: demo\n description: This value is assigned by the service provider, in this example `gigantic-server.com`\n port:\n enum:\n - \'8883\'\n - \'8884\'\n default: \'8883\'\n```\n\n\n#### Server Variable Object\n\nAn object representing a Server Variable for server URL template substitution.\n', + docs: '#### Server Object\n\nAn object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data. This object is used to capture details such as URIs, protocols and security configuration. Variable substitution can be used so that some details, for example usernames and passwords, can be injected by code generation tools.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\nurl | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be made when a variable is named in `{`braces`}`.\nprotocol | `string` | **REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `ibmmq`, `jms`, `kafka`, `kafka-secure`, `anypointmq`, `mqtt`, `secure-mqtt`, `solace`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.\nprotocolVersion | `string` | The version of the protocol used for connection. For instance: AMQP `0.9.1`, HTTP `2.0`, Kafka `1.0.0`, etc.\ndescription | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.\nvariables | Map[`string`, [Server Variable Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverVariableObject)] | A map between a variable name and its value. The value is used for substitution in the server\'s URL template.\nsecurity | [[Security Requirement Object](https://www.asyncapi.com/docs/specifications/v2.3.0#securityRequirementObject)] | A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a connection or operation.\nbindings | [Server Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.\n\nThis object MAY be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### Server Object Example\n\nA single server would be described as:\n\n```json\n{\n "url": "development.gigantic-server.com",\n "description": "Development server",\n "protocol": "kafka",\n "protocolVersion": "1.0.0"\n}\n```\n\n```yaml\nurl: development.gigantic-server.com\ndescription: Development server\nprotocol: kafka\nprotocolVersion: \'1.0.0\'\n```\n\nThe following shows how multiple servers can be described, for example, at the AsyncAPI Object\'s [`servers`](https://www.asyncapi.com/docs/specifications/v2.3.0#A2SServers):\n\n```json\n{\n "servers": {\n "development": {\n "url": "development.gigantic-server.com",\n "description": "Development server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n },\n "staging": {\n "url": "staging.gigantic-server.com",\n "description": "Staging server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n },\n "production": {\n "url": "api.gigantic-server.com",\n "description": "Production server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n }\n }\n}\n```\n\n```yaml\nservers:\n development:\n url: development.gigantic-server.com\n description: Development server\n protocol: amqp\n protocolVersion: 0.9.1\n staging:\n url: staging.gigantic-server.com\n description: Staging server\n protocol: amqp\n protocolVersion: 0.9.1\n production:\n url: api.gigantic-server.com\n description: Production server\n protocol: amqp\n protocolVersion: 0.9.1\n```', }, ]; export default serverDocs; diff --git a/packages/apidom-ls/src/config/asyncapi/servers/docs/servers.ts b/packages/apidom-ls/src/config/asyncapi/servers/docs/servers.ts index bf381075a0..f67f8161d2 100644 --- a/packages/apidom-ls/src/config/asyncapi/servers/docs/servers.ts +++ b/packages/apidom-ls/src/config/asyncapi/servers/docs/servers.ts @@ -1,6 +1,6 @@ const serversDocs = [ { - docs: '#### [Servers](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#a2sservers)\n\n\nField Name | Type | Description\n---|:---:|---\nservers | [Servers Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#serversObject) | Provides connection details of servers.\n\n#### Servers Object\n\nThe Servers Object is a map of [Server Objects](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#serverObject).\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n`^[A-Za-z0-9_\\-]+$` | [Server Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#serverObject) | The definition of a server this application MAY connect to.\n\n##### Servers Object Example\n\n```json\n{\n "production": {\n "url": "development.gigantic-server.com",\n "description": "Development server",\n "protocol": "kafka",\n "protocolVersion": "1.0.0"\n }\n}\n```\n\n```yaml\nproduction:\n url: development.gigantic-server.com\n description: Development server\n protocol: kafka\n protocolVersion: \'1.0.0\'\n```\n\n\n#### Server Object\n\nAn object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data. This object is used to capture details such as URIs, protocols and security configuration. Variable substitution can be used so that some details, for example usernames and passwords, can be injected by code generation tools.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\nurl | `string` | **REQUIRED**. A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the AsyncAPI document is being served. Variable substitutions will be made when a variable is named in `{`brackets`}`.\nprotocol | `string` | **REQUIRED**. The protocol this URL supports for connection. Supported protocol include, but are not limited to: `amqp`, `amqps`, `http`, `https`, `jms`, `kafka`, `kafka-secure`, `mqtt`, `secure-mqtt`, `stomp`, `stomps`, `ws`, `wss`, `mercure`.\nprotocolVersion | `string` | The version of the protocol used for connection. For instance: AMQP `0.9.1`, HTTP `2.0`, Kafka `1.0.0`, etc.\ndescription | `string` | An optional string describing the host designated by the URL. [CommonMark syntax](http://spec.commonmark.org/) MAY be used for rich text representation.\nvariables | Map[`string`, [Server Variable Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#serverVariableObject)] | A map between a variable name and its value. The value is used for substitution in the server\'s URL template.\nsecurity | [[Security Requirement Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#securityRequirementObject)] | A declaration of which security mechanisms can be used with this server. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a connection or operation.\nbindings | [Server Bindings Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#serverBindingsObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the server.\n\nThis object MAY be extended with [Specification Extensions](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#specificationExtensions).\n\n##### Server Object Example\n\nA single server would be described as:\n\n```json\n{\n "url": "development.gigantic-server.com",\n "description": "Development server",\n "protocol": "kafka",\n "protocolVersion": "1.0.0"\n}\n```\n\n```yaml\nurl: development.gigantic-server.com\ndescription: Development server\nprotocol: kafka\nprotocolVersion: \'1.0.0\'\n```\n\nThe following shows how multiple servers can be described, for example, at the AsyncAPI Object\'s [`servers`](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#A2SServers):\n\n```json\n{\n "servers": {\n "development": {\n "url": "development.gigantic-server.com",\n "description": "Development server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n },\n "staging": {\n "url": "staging.gigantic-server.com",\n "description": "Staging server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n },\n "production": {\n "url": "api.gigantic-server.com",\n "description": "Production server",\n "protocol": "amqp",\n "protocolVersion": "0.9.1"\n }\n }\n}\n```\n\n```yaml\nservers:\n development:\n url: development.gigantic-server.com\n description: Development server\n protocol: amqp\n protocolVersion: 0.9.1\n staging:\n url: staging.gigantic-server.com\n description: Staging server\n protocol: amqp\n protocolVersion: 0.9.1\n production:\n url: api.gigantic-server.com\n description: Production server\n protocol: amqp\n protocolVersion: 0.9.1\n```\n\nThe following shows how variables can be used for a server configuration:\n\n```json\n{\n "servers": {\n "production": {\n "url": "{username}.gigantic-server.com:{port}/{basePath}",\n "description": "The production API server",\n "protocol": "secure-mqtt",\n "variables": {\n "username": {\n "default": "demo",\n "description": "This value is assigned by the service provider, in this example `gigantic-server.com`"\n },\n "port": {\n "enum": [\n "8883",\n "8884"\n ],\n "default": "8883"\n }\n }\n }\n }\n}\n```\n\n```yaml\nservers:\n production:\n url: \'{username}.gigantic-server.com:{port}/{basePath}\'\n description: The production API server\n protocol: secure-mqtt\n variables:\n username:\n # note! no enum here means it is an open value\n default: demo\n description: This value is assigned by the service provider, in this example `gigantic-server.com`\n port:\n enum:\n - \'8883\'\n - \'8884\'\n default: \'8883\'\n```\n\n\n#### Server Variable Object\n\nAn object representing a Server Variable for server URL template substitution.\n', + docs: '#### [Servers Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serversObject)\n\nThe Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n`^[A-Za-z0-9_\\-]+$` | [Server Object](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject) | The definition of a server this application MAY connect to.\n\n##### Servers Object Example\n\n```json\n{\n "production": {\n "url": "development.gigantic-server.com",\n "description": "Development server",\n "protocol": "kafka",\n "protocolVersion": "1.0.0"\n }\n}\n```\n\n```yaml\nproduction:\n url: development.gigantic-server.com\n description: Development server\n protocol: kafka\n protocolVersion: \'1.0.0\'\n```', }, ]; export default serversDocs; diff --git a/packages/apidom-ls/test/asyncapi-json.ts b/packages/apidom-ls/test/asyncapi-json.ts index 89d2ffce78..a6756d3c62 100644 --- a/packages/apidom-ls/test/asyncapi-json.ts +++ b/packages/apidom-ls/test/asyncapi-json.ts @@ -82,7 +82,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\n ---- \n\nIt is **RECOMMENDED** to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', + 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\\\n\\\nIt is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', }, }, { @@ -93,7 +93,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - "A string representing the default content type to use when encoding/decoding a message's payload. The value **MUST** be a specific media type (e.g. `application/json`). This value **MUST** be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectContentType) property is omitted.", + "A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectContentType) property is omitted.\n\\\n\\\nIn case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.", }, }, { @@ -104,7 +104,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, }, { @@ -115,7 +115,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).', + 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, }, { @@ -148,7 +148,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - '#### External Documentation Object\n\n ---- \n\nnAllows referencing an external resource for extended documentation.\n\n ---- \n\n##### Fixed Fields\n\n ---- \n\n**description** (`string`) : A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\n\n ---- \n\n**url** (`string`) : **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '#### External Documentation Object\n\\\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nurl | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### External Documentation Object Example\n\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```', }, }, ], @@ -169,7 +169,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'The version string signifies the version of the AsyncAPI Specification that the document complies to. The format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.\n\n ---- \n\nA `major`.`minor` shall be used to designate the AsyncAPI Specification version, and will be considered compatible with the AsyncAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `1.0.0` and `1.0.1`.\n\n ---- \n\nIn subsequent versions of the AsyncAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `1.1.0` specification should be usable with tooling designed for `1.0.0`.\n\n', + 'The version string signifies the version of the AsyncAPI Specification that the document complies to.\nThe format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.\n\\\n\\\nA `major`.`minor` shall be used to designate the AsyncAPI Specification version, and will be considered compatible with the AsyncAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `1.0.0` and `1.0.1`.\n\\\n\\\nIn subsequent versions of the AsyncAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `1.1.0` specification should be usable with tooling designed for `1.0.0`.', }, }, { @@ -180,7 +180,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\n ---- \n\nIt is **RECOMMENDED** to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', + 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\\\n\\\nIt is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', }, }, { @@ -191,7 +191,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - "A string representing the default content type to use when encoding/decoding a message's payload. The value **MUST** be a specific media type (e.g. `application/json`). This value **MUST** be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectContentType) property is omitted.", + "A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectContentType) property is omitted.\n\\\n\\\nIn case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.", }, }, { @@ -202,7 +202,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, }, { @@ -213,7 +213,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).', + 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, }, { @@ -246,7 +246,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - '#### External Documentation Object\n\n ---- \n\nnAllows referencing an external resource for extended documentation.\n\n ---- \n\n##### Fixed Fields\n\n ---- \n\n**description** (`string`) : A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\n\n ---- \n\n**url** (`string`) : **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '#### External Documentation Object\n\\\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nurl | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### External Documentation Object Example\n\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```', }, }, ], @@ -278,7 +278,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\n ---- \n\nIt is **RECOMMENDED** to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', + 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\\\n\\\nIt is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', }, }, { @@ -289,7 +289,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - "A string representing the default content type to use when encoding/decoding a message's payload. The value **MUST** be a specific media type (e.g. `application/json`). This value **MUST** be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectContentType) property is omitted.", + "A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectContentType) property is omitted.\n\\\n\\\nIn case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.", }, }, { @@ -300,7 +300,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, }, { @@ -311,7 +311,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).', + 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, }, { @@ -344,7 +344,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - '#### External Documentation Object\n\n ---- \n\nnAllows referencing an external resource for extended documentation.\n\n ---- \n\n##### Fixed Fields\n\n ---- \n\n**description** (`string`) : A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\n\n ---- \n\n**url** (`string`) : **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '#### External Documentation Object\n\\\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nurl | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### External Documentation Object Example\n\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```', }, }, ], @@ -362,7 +362,7 @@ const hoverTestInput = [ contents: { kind: 'markdown', value: - '***subscribe***: **operation**\n\n[Operation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationObject)\n\n ---- \n\nA definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.\n\n ---- \n\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received. For example, an operation might describe a chat application use case where a user sends a text message to a group.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n[operationId](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectOperationId) | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\n[summary](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectSummary) | `string` | A short summary of what the operation is about.\n[description](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectDescription) | `string` | A verbose explanation of the operation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.\n[tags](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTags) | [Tags Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\n[externalDocs](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectExternalDocs) | [External Documentation Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#externalDocumentationObject) | Additional external documentation for this operation.\n[bindings](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectBindings) | [Operation Bindings Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationBindingsObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\n[traits](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTraits) | [[Operation Trait Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationTraitObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\n[message](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectMessage) | [[Message Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#messageObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject)] | A definition of the message that will be published or received on this channel. `oneOf` is allowed here to specify multiple messages, however, **a message MUST be valid only against one of the referenced message objects.**\n\nThis object can be extended with [Specification Extensions](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n },\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```\n', + '***subscribe***: **operation**\n\n[Operation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationObject)\n\\\n\\\nA definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.\n\\\n\\\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.\n\\\n\\\nFor example, an operation might describe a chat application use case where a user sends a text message to a group. A publish operation describes messages that are received by the chat application, whereas a subscribe operation describes messages that are sent by the chat application.\n\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\noperationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\nsummary | `string` | A short summary of what the operation is about.\ndescription | `string` | A verbose explanation of the operation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\ntags | [Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\nexternalDocs | [External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject) | Additional external documentation for this operation.\nbindings | [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\ntraits | [[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\nmessage | [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | Map["oneOf", [[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]] | A definition of the message that will be published or received by this operation. Map containing a single `oneOf` key is allowed here to specify multiple messages. However, **a message MUST be valid only against one of the message objects.**\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n }\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```', }, range: { start: { line: 10, character: 6 }, end: { line: 10, character: 17 } }, }, @@ -449,7 +449,6 @@ describe('apidom-ls-async', function () { 0, specCompletion, ); - for (const input of completionTestInput) { // eslint-disable-next-line no-console console.log(`testing completion for ${input[0]}`); @@ -460,6 +459,7 @@ describe('apidom-ls-async', function () { { textDocument: doc, position: pos }, completionContext, ); + assert.deepEqual(result, input[3] as CompletionList); } }); diff --git a/packages/apidom-ls/test/asyncapi-yaml.ts b/packages/apidom-ls/test/asyncapi-yaml.ts index a14e80702d..30899310c5 100644 --- a/packages/apidom-ls/test/asyncapi-yaml.ts +++ b/packages/apidom-ls/test/asyncapi-yaml.ts @@ -111,7 +111,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'The version string signifies the version of the AsyncAPI Specification that the document complies to. The format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.\n\n ---- \n\nA `major`.`minor` shall be used to designate the AsyncAPI Specification version, and will be considered compatible with the AsyncAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `1.0.0` and `1.0.1`.\n\n ---- \n\nIn subsequent versions of the AsyncAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `1.1.0` specification should be usable with tooling designed for `1.0.0`.\n\n', + 'The version string signifies the version of the AsyncAPI Specification that the document complies to.\nThe format for this string _must_ be `major`.`minor`.`patch`. The `patch` _may_ be suffixed by a hyphen and extra alphanumeric characters.\n\\\n\\\nA `major`.`minor` shall be used to designate the AsyncAPI Specification version, and will be considered compatible with the AsyncAPI Specification specified by that `major`.`minor` version. The patch version will not be considered by tooling, making no distinction between `1.0.0` and `1.0.1`.\n\\\n\\\nIn subsequent versions of the AsyncAPI Specification, care will be given such that increments of the `minor` version should not interfere with operations of tooling developed to a lower minor version. Thus a hypothetical `1.1.0` specification should be usable with tooling designed for `1.0.0`.', }, }, { @@ -122,7 +122,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\n ---- \n\nIt is **RECOMMENDED** to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', + 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\\\n\\\nIt is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', }, }, { @@ -133,7 +133,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - "A string representing the default content type to use when encoding/decoding a message's payload. The value **MUST** be a specific media type (e.g. `application/json`). This value **MUST** be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectContentType) property is omitted.", + "A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectContentType) property is omitted.\n\\\n\\\nIn case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.", }, }, { @@ -144,7 +144,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, }, { @@ -155,7 +155,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).', + 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, }, { @@ -177,7 +177,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - '#### External Documentation Object\n\n ---- \n\nnAllows referencing an external resource for extended documentation.\n\n ---- \n\n##### Fixed Fields\n\n ---- \n\n**description** (`string`) : A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\n\n ---- \n\n**url** (`string`) : **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '#### External Documentation Object\n\\\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nurl | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### External Documentation Object Example\n\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```', }, }, ], @@ -209,7 +209,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\n ---- \n\nIt is **RECOMMENDED** to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', + 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\\\n\\\nIt is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', }, }, { @@ -220,7 +220,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - "A string representing the default content type to use when encoding/decoding a message's payload. The value **MUST** be a specific media type (e.g. `application/json`). This value **MUST** be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectContentType) property is omitted.", + "A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectContentType) property is omitted.\n\\\n\\\nIn case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.", }, }, { @@ -231,7 +231,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, }, { @@ -242,7 +242,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).', + 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, }, { @@ -264,7 +264,7 @@ const completionTestInput = [ documentation: { kind: 'markdown', value: - '#### External Documentation Object\n\n ---- \n\nnAllows referencing an external resource for extended documentation.\n\n ---- \n\n##### Fixed Fields\n\n ---- \n\n**description** (`string`) : A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\n\n ---- \n\n**url** (`string`) : **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '#### External Documentation Object\n\\\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nurl | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### External Documentation Object Example\n\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```', }, }, ], @@ -282,7 +282,7 @@ const hoverTestInput = [ contents: { kind: 'markdown', value: - '***subscribe***: **operation**\n\n[Operation Object](https://www.asyncapi.com/docs/specifications/v2.2.0#operationObject)\n\n ---- \n\nA definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.\n\n ---- \n\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received. For example, an operation might describe a chat application use case where a user sends a text message to a group.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n[operationId](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectOperationId) | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\n[summary](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectSummary) | `string` | A short summary of what the operation is about.\n[description](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectDescription) | `string` | A verbose explanation of the operation. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.\n[tags](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTags) | [Tags Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\n[externalDocs](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectExternalDocs) | [External Documentation Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#externalDocumentationObject) | Additional external documentation for this operation.\n[bindings](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectBindings) | [Operation Bindings Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationBindingsObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\n[traits](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectTraits) | [[Operation Trait Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationTraitObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\n[message](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#operationObjectMessage) | [[Message Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#messageObject) | [Reference Object](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#referenceObject)] | A definition of the message that will be published or received on this channel. `oneOf` is allowed here to specify multiple messages, however, **a message MUST be valid only against one of the referenced message objects.**\n\nThis object can be extended with [Specification Extensions](https://github.com/asyncapi/asyncapi/blob/master/versions/2.0.0/asyncapi.md#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n },\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```\n', + '***subscribe***: **operation**\n\n[Operation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationObject)\n\\\n\\\nA definition of the SUBSCRIBE operation, which defines the messages produced by the application and sent to the channel.\n\\\n\\\nDescribes a publish or a subscribe operation. This provides a place to document how and why messages are sent and received.\n\\\n\\\nFor example, an operation might describe a chat application use case where a user sends a text message to a group. A publish operation describes messages that are received by the chat application, whereas a subscribe operation describes messages that are sent by the chat application.\n\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\noperationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. The operationId value is **case-sensitive**. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.\nsummary | `string` | A short summary of what the operation is about.\ndescription | `string` | A verbose explanation of the operation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\ntags | [Tags Object](https://www.asyncapi.com/docs/specifications/v2.3.0#tagsObject) | A list of tags for API documentation control. Tags can be used for logical grouping of operations.\nexternalDocs | [External Documentation Object](https://www.asyncapi.com/docs/specifications/v2.3.0#externalDocumentationObject) | Additional external documentation for this operation.\nbindings | [Operation Bindings Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationBindingsObject) \\| [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.\ntraits | [[Operation Trait Object](https://www.asyncapi.com/docs/specifications/v2.3.0#operationTraitObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) ] | A list of traits to apply to the operation object. Traits MUST be merged into the operation object using the [JSON Merge Patch](https://tools.ietf.org/html/rfc7386) algorithm in the same order they are defined here.\nmessage | [Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject) | Map["oneOf", [[Message Object](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObject) | [Reference Object](https://www.asyncapi.com/docs/specifications/v2.3.0#referenceObject)]] | A definition of the message that will be published or received by this operation. Map containing a single `oneOf` key is allowed here to specify multiple messages. However, **a message MUST be valid only against one of the message objects.**\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### Operation Object Example\n\n```json\n{\n "operationId": "registerUser",\n "summary": "Action to sign a user up.",\n "description": "A longer description",\n "tags": [\n { "name": "user" },\n { "name": "signup" },\n { "name": "register" }\n ],\n "message": {\n "headers": {\n "type": "object",\n "properties": {\n "applicationInstanceId": {\n "description": "Unique identifier for a given instance of the publishing application",\n "type": "string"\n }\n }\n },\n "payload": {\n "type": "object",\n "properties": {\n "user": {\n "$ref": "#/components/schemas/userCreate"\n },\n "signup": {\n "$ref": "#/components/schemas/signup"\n }\n }\n }\n },\n "bindings": {\n "amqp": {\n "ack": false\n }\n },\n "traits": [\n { "$ref": "#/components/operationTraits/kafka" }\n ]\n}\n```\n\n```yaml\noperationId: registerUser\nsummary: Action to sign a user up.\ndescription: A longer description\ntags:\n - name: user\n - name: signup\n - name: register\nmessage:\n headers:\n type: object\n properties:\n applicationInstanceId:\n description: Unique identifier for a given instance of the publishing application\n type: string\n payload:\n type: object\n properties:\n user:\n $ref: "#/components/schemas/userCreate"\n signup:\n $ref: "#/components/schemas/signup"\nbindings:\n amqp:\n ack: false\ntraits:\n - $ref: "#/components/operationTraits/kafka"\n```', }, range: { start: { line: 8, character: 4 }, end: { line: 8, character: 13 } }, }, diff --git a/packages/apidom-ls/test/complete.ts b/packages/apidom-ls/test/complete.ts index dff0f0125d..62253fdaae 100644 --- a/packages/apidom-ls/test/complete.ts +++ b/packages/apidom-ls/test/complete.ts @@ -176,7 +176,7 @@ describe('apidom-ls-complete', function () { documentation: { kind: 'markdown', value: - 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\n ---- \n\nIt is **RECOMMENDED** to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', + 'This field represents a unique universal identifier of the [application](https://www.asyncapi.com/docs/specifications/v2.3.0#definitionsApplication) the AsyncAPI document is defining. It must conform to the URI format, according to [RFC3986](https://tools.ietf.org/html/rfc3986).\n\\\n\\\nIt is RECOMMENDED to use a [URN](https://tools.ietf.org/html/rfc8141) to globally and uniquely identify the application during long periods of time, even after it becomes unavailable or ceases to exist.', }, }, { @@ -187,7 +187,7 @@ describe('apidom-ls-complete', function () { documentation: { kind: 'markdown', value: - "A string representing the default content type to use when encoding/decoding a message's payload. The value **MUST** be a specific media type (e.g. `application/json`). This value **MUST** be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.2.0#messageObjectContentType) property is omitted.", + "A string representing the default content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. `application/json`). This value MUST be used by schema parsers when the [contentType](https://www.asyncapi.com/docs/specifications/v2.3.0#messageObjectContentType) property is omitted.\n\\\n\\\nIn case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.", }, }, { @@ -198,7 +198,7 @@ describe('apidom-ls-complete', function () { documentation: { kind: 'markdown', value: - 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\n ---- \n\nChannels are also known as "topics", "routing keys", "event types" or "paths".', + 'Holds the relative paths to the individual channel and their operations. Channel paths are relative to servers.\n\\\n\\\nChannels are also known as "topics", "routing keys", "event types" or "paths".', }, }, { @@ -209,7 +209,7 @@ describe('apidom-ls-complete', function () { documentation: { kind: 'markdown', value: - 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).', + 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).', }, }, { @@ -231,7 +231,7 @@ describe('apidom-ls-complete', function () { documentation: { kind: 'markdown', value: - '#### External Documentation Object\n\n ---- \n\nnAllows referencing an external resource for extended documentation.\n\n ---- \n\n##### Fixed Fields\n\n ---- \n\n**description** (`string`) : A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\n\n ---- \n\n**url** (`string`) : **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n ---- \n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.2.0#specificationExtensions).', + '#### External Documentation Object\n\\\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\ndescription | `string` | A short description of the target documentation. [CommonMark syntax](https://spec.commonmark.org/) can be used for rich text representation.\nurl | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\nThis object can be extended with [Specification Extensions](https://www.asyncapi.com/docs/specifications/v2.3.0#specificationExtensions).\n\n##### External Documentation Object Example\n\n```json\n{\n "description": "Find more info here",\n "url": "https://example.com"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://example.com\n```', }, }, ],