Skip to content

Commit 6f8ac59

Browse files
authored
fix(apidom-ls): fix all documentation URLs to point to AsyncAPI 2.3.0 docs (#1286)
Closes #1284
1 parent c2a2a81 commit 6f8ac59

File tree

36 files changed

+472
-285
lines changed

36 files changed

+472
-285
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* Before using transform function please use
3+
* this tool https://markdown-it.github.io/ to verify how your Markdown renders.
4+
*/
5+
6+
const transform = (str) => {
7+
console.log(JSON.stringify(str.trim().replace(/(\r\n|\n|\r)/gm, '\n')));
8+
};
9+
10+
transform(
11+
`#### Servers Object
12+
13+
The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).
14+
15+
##### Patterned Fields
16+
17+
Field Pattern | Type | Description
18+
---|:---:|---
19+
\`^[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.
20+
21+
##### Servers Object Example
22+
23+
\`\`\`json
24+
{
25+
"production": {
26+
"url": "development.gigantic-server.com",
27+
"description": "Development server",
28+
"protocol": "kafka",
29+
"protocolVersion": "1.0.0"
30+
}
31+
}
32+
\`\`\`
33+
34+
\`\`\`yaml
35+
production:
36+
url: development.gigantic-server.com
37+
description: Development server
38+
protocol: kafka
39+
protocolVersion: '1.0.0'
40+
\`\`\``,
41+
);

packages/apidom-ls/src/config/asyncapi/asyncapi2/complete/asyncapi2.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [
2828
documentation: {
2929
kind: 'markdown',
3030
value:
31-
'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',
31+
'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`.',
3232
},
3333
},
3434
{
@@ -41,7 +41,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [
4141
documentation: {
4242
kind: 'markdown',
4343
value:
44-
'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.',
44+
'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.',
4545
},
4646
},
4747
{
@@ -54,7 +54,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [
5454
documentation: {
5555
kind: 'markdown',
5656
value:
57-
"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.",
57+
"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.",
5858
},
5959
},
6060
{
@@ -67,7 +67,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [
6767
documentation: {
6868
kind: 'markdown',
6969
value:
70-
'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".',
70+
'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".',
7171
},
7272
},
7373
{
@@ -80,7 +80,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [
8080
documentation: {
8181
kind: 'markdown',
8282
value:
83-
'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).',
83+
'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).',
8484
},
8585
},
8686
{
@@ -119,7 +119,7 @@ const asyncapiRootComplete: ApidomCompletionItem[] = [
119119
documentation: {
120120
kind: 'markdown',
121121
value:
122-
'#### 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).',
122+
'#### 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```',
123123
},
124124
},
125125
{
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
const asyncapi2Docs = [
22
{
33
target: 'asyncapi',
4-
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',
4+
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`.',
55
},
66
{
77
target: 'id',
8-
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.',
8+
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.',
99
},
1010
{
1111
target: 'info',
1212
docs: 'The object provides metadata about the API. The metadata can be used by the clients if needed.',
1313
},
1414
{
1515
target: 'servers',
16-
docs: 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.2.0#serverObject).',
16+
docs: 'The Servers Object is a map of [Server Objects](https://www.asyncapi.com/docs/specifications/v2.3.0#serverObject).',
1717
},
1818
{
1919
target: 'defaultContentType',
20-
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.",
20+
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.",
2121
},
2222
{
2323
target: 'channels',
24-
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".',
24+
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".',
2525
},
2626
{
2727
target: 'components',
@@ -31,5 +31,9 @@ const asyncapi2Docs = [
3131
target: 'tags',
3232
docs: 'A list of tags used by the specification with additional metadata. Each tag name in the list **MUST** be unique.',
3333
},
34+
{
35+
target: 'externalDocs',
36+
docs: 'Additional external documentation.',
37+
},
3438
];
3539
export default asyncapi2Docs;

packages/apidom-ls/src/config/asyncapi/channel-item/complete/channel-item.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [
1515
documentation: {
1616
kind: 'markdown',
1717
value:
18-
"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_.",
18+
"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.",
1919
},
2020
},
2121
{
@@ -41,7 +41,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [
4141
documentation: {
4242
kind: 'markdown',
4343
value:
44-
'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).',
44+
'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).',
4545
},
4646
},
4747
{
@@ -54,7 +54,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [
5454
documentation: {
5555
kind: 'markdown',
5656
value:
57-
'[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.',
57+
'#### [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.',
5858
},
5959
},
6060
{
@@ -67,7 +67,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [
6767
documentation: {
6868
kind: 'markdown',
6969
value:
70-
'[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.',
70+
'#### [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.',
7171
},
7272
},
7373
{
@@ -80,7 +80,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [
8080
documentation: {
8181
kind: 'markdown',
8282
value:
83-
'[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)).',
83+
'#### [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)).',
8484
},
8585
},
8686
{
@@ -93,7 +93,7 @@ const channelCompleteJson: ApidomCompletionItem[] = [
9393
documentation: {
9494
kind: 'markdown',
9595
value:
96-
'[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).',
96+
'#### [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.',
9797
},
9898
},
9999
{

0 commit comments

Comments
 (0)