Skip to content

Commit 1f3a3c1

Browse files
authored
feat(apidom-ls): docs & config of compatible properties in AsyncAPI3 (#5095)
1 parent 7a9ed4c commit 1f3a3c1

File tree

87 files changed

+1048
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1048
-59
lines changed

packages/apidom-ls/src/config/asyncapi/async-api-version/completion.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ const completion: ApidomCompletionItem[] = [
6161
type: CompletionType.VALUE,
6262
insertTextFormat: 2,
6363
},
64+
{
65+
label: '3.0.0',
66+
insertText: '3.0.0',
67+
kind: 12,
68+
format: CompletionFormat.QUOTED_FORCED,
69+
type: CompletionType.VALUE,
70+
insertTextFormat: 2,
71+
},
6472
];
6573

6674
export default completion;

packages/apidom-ls/src/config/asyncapi/async-api-version/documentation.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
import { AsyncAPI2, AsyncAPI3 } from '../target-specs.ts';
2+
13
const documentation = [
24
{
35
docs: '#### [AsyncAPI Version String](https://www.asyncapi.com/docs/reference/specification/v2.6.0#A2SVersionString)\n\nThe 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.\nThe 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`.',
6+
targetSpecs: AsyncAPI2,
7+
},
8+
{
9+
docs: '#### [AsyncAPI Version String](https://www.asyncapi.com/docs/reference/specification/v3.0.0#A2SVersionString)\n\nThe 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\\\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`.',
10+
targetSpecs: AsyncAPI3,
411
},
512
];
613

packages/apidom-ls/src/config/asyncapi/async-api-version/lint/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import valuePattern2_3_0Lint from './value--pattern-2-3-0.ts';
55
import valuePattern2_4_0Lint from './value--pattern-2-4-0.ts';
66
import valuePattern2_5_0Lint from './value--pattern-2-5-0.ts';
77
import valuePattern2_6_0Lint from './value--pattern-2-6-0.ts';
8+
import valuePattern3_0_0Lint from './value--pattern-3-0-0.ts';
89

910
const lints = [
1011
valuePattern2_0_0Lint,
@@ -14,6 +15,7 @@ const lints = [
1415
valuePattern2_4_0Lint,
1516
valuePattern2_5_0Lint,
1617
valuePattern2_6_0Lint,
18+
valuePattern3_0_0Lint,
1719
];
1820

1921
export default lints;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { LinterMeta } from '../../../../apidom-language-types.ts';
2+
3+
// eslint-disable-next-line @typescript-eslint/naming-convention
4+
const valuePattern3_0_0Lint: LinterMeta = {};
5+
6+
export default valuePattern3_0_0Lint;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { ApidomCompletionItem } from '../../../apidom-language-types.ts';
2+
3+
const completion: ApidomCompletionItem[] = [];
4+
5+
export default completion;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const documentation = [
2+
{
3+
docs: '', // Add all the allowed fields link here.
4+
},
5+
];
6+
7+
export default documentation;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { LinterMeta } from '../../../../apidom-language-types.ts';
2+
3+
const allowedFieldsLint: LinterMeta = {};
4+
export default allowedFieldsLint;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import allowedFieldsLint from './allowed-fields.ts';
2+
3+
const lints = [
4+
allowedFieldsLint,
5+
// add all the remaining lints here
6+
];
7+
8+
export default lints;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { FormatMeta } from '../../../apidom-language-types.ts';
2+
import lint from './lint/index.ts';
3+
import completion from './completion.ts';
4+
import documentation from './documentation.ts';
5+
6+
const meta: FormatMeta = {
7+
lint,
8+
completion,
9+
documentation,
10+
};
11+
12+
export default meta;

packages/apidom-ls/src/config/asyncapi/bindings/amqp/channel-binding/documentation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const documentation = [
1313
},
1414
{
1515
target: 'bindingVersion',
16-
docs: 'The version of this binding. If omitted, "0.2.0" MUST be assumed.',
16+
docs: 'The version of this binding. If omitted, "0.3.0" MUST be assumed.',
1717
},
1818
{
1919
docs: '#### [Channel Binding Object](https://github.com/asyncapi/bindings/tree/master/amqp#channel)\n\nThis object contains information about the channel representation in AMQP.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n`is` | string | Defines what type of channel is it. Can be either `queue` or `routingKey` (default).\n`exchange` | Map[string, any] | When `is`=`routingKey`, this object defines the exchange properties.\n`exchange.name` | string | The name of the exchange. It MUST NOT exceed 255 characters long.\n`exchange.type` | string | The type of the exchange. Can be either `topic`, `direct`, `fanout`, `default` or `headers`.\n`exchange.durable` | boolean | Whether the exchange should survive broker restarts or not.\n`exchange.autoDelete` | boolean | Whether the exchange should be deleted when the last queue is unbound from it.\n`exchange.vhost` | string | The virtual host of the exchange. Defaults to `/`.\n`queue` | Map[string, any] | When `is`=`queue`, this object defines the queue properties.\n`queue.name` | string | The name of the queue. It MUST NOT exceed 255 characters long.\n`queue.durable` | boolean | Whether the queue should survive broker restarts or not.\n`queue.exclusive` | boolean | Whether the queue should be used only by one connection or not.\n`queue.autoDelete` | boolean | Whether the queue should be deleted when the last consumer unsubscribes.\n`queue.vhost` | string | The virtual host of the queue. Defaults to `/`.\n`bindingVersion` | string | The version of this binding. If omitted, "0.2.0" MUST be assumed.\n\nThis object MUST contain only the properties defined above.\n\n##### Example\n\n\n\\\nYAML\n```yaml\nchannels:\n user/signedup:\n bindings:\n amqp:\n is: routingKey\n queue:\n name: my-queue-name\n durable: true\n exclusive: true\n autoDelete: false\n vhost: /\n exchange:\n name: myExchange\n type: topic\n durable: true\n autoDelete: false\n vhost: /\n bindingVersion: 0.2.0\n```',

0 commit comments

Comments
 (0)