Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { DiagnosticSeverity } from 'vscode-languageserver-types';

import ApilintCodes from '../../../../../../codes.ts';
import { LinterMeta } from '../../../../../../../apidom-language-types.ts';

const allowedFieldsLint: LinterMeta = {
code: ApilintCodes.NOT_ALLOWED_FIELDS,
source: 'apilint',
message: 'This object MUST NOT contain any properties. Its name is reserved for future use.',
severity: DiagnosticSeverity.Error,
linterFunction: 'allowedFields',
linterParams: [[]],
marker: 'key',
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
};

export default allowedFieldsLint;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import allowedFieldsLint from './allowed-fields.ts';

const lints = [allowedFieldsLint];

export default lints;
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import channelBinding0_1_0Lints from './0-1-0/index.ts';
import channelBinding0_2_0Lints from './0-2-0/index.ts';
import channelBindingLatestLints from './latest/index.ts';

const lints = [...channelBinding0_1_0Lints, ...channelBindingLatestLints];
const lints = [
...channelBinding0_1_0Lints,
...channelBinding0_2_0Lints,
...channelBindingLatestLints,
];

export default lints;
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
import {
ApidomCompletionItem,
CompletionFormat,
CompletionType,
} from '../../../../../../apidom-language-types.ts';
import { AsyncAPI2, AsyncAPI3 } from '../../../../target-specs.ts';

const completion: ApidomCompletionItem[] = [
{
label: 'payloadFormatIndicator',
insertText: 'payloadFormatIndicator',
kind: 14,
format: CompletionFormat.UNQUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'MQTT Version `5`. `integer`\n\\\n\\\nEither: **0** (zero): Indicates that the payload is unspecified bytes, or **1**: Indicates that the payload is UTF-8 encoded character data.',
},
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
},
{
label: 'correlationData',
insertText: 'correlationData',
kind: 14,
format: CompletionFormat.OBJECT,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'MQTT Version `5`. [Schema Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#referenceObject)\n\\\n\\\nCorrelation Data is used by the sender of the request message to identify which request the response message is for when it is received.',
},
targetSpecs: AsyncAPI2,
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
},
{
label: 'correlationData',
insertText: 'correlationData',
kind: 14,
format: CompletionFormat.OBJECT,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'MQTT Version `5`. [Schema Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#referenceObject)\n\\\n\\\nCorrelation Data is used by the sender of the request message to identify which request the response message is for when it is received.',
},
targetSpecs: AsyncAPI3,
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
},
{
label: 'contentType',
insertText: 'contentType',
kind: 14,
format: CompletionFormat.QUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'MQTT Version `5`. `string`\n\\\n\\\nString describing the content type of the message payload. This should not conflict with the `contentType` field of the associated AsyncAPI Message object.',
},
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
},
{
label: 'responseTopic',
insertText: 'responseTopic',
kind: 14,
format: CompletionFormat.QUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'MQTT Version `5`. `URI string` \\| [Schema Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v2.6.0#referenceObject)\n\\\n\\\nThe topic (channel URI) for a response message.',
},
targetSpecs: AsyncAPI2,
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
},
{
label: 'responseTopic',
insertText: 'responseTopic',
kind: 14,
format: CompletionFormat.QUOTED,
type: CompletionType.PROPERTY,
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value:
'MQTT Version `5`. `URI string` \\| [Schema Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#schemaObject) \\| [Reference Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#referenceObject)\n\\\n\\\nThe topic (channel URI) for a response message.',
},
targetSpecs: AsyncAPI3,
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
},
{
target: 'payloadFormatIndicator',
label: '0',
insertText: '0',
kind: 12,
format: CompletionFormat.UNQUOTED,
type: CompletionType.VALUE,
insertTextFormat: 2,
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
},
{
target: 'payloadFormatIndicator',
label: '1',
insertText: '1',
kind: 12,
format: CompletionFormat.UNQUOTED,
type: CompletionType.VALUE,
insertTextFormat: 2,
conditions: [
{
targets: [{ path: 'bindingVersion' }],
function: 'apilintValueOrArray',
params: [['0.2.0']],
},
],
},
];

export default completion;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import completion0_1_0Items from './0-1-0.ts';
import completion0_2_0Items from './0-2-0.ts';
import completionLatestItems from './latest.ts';
import {
ApidomCompletionItem,
Expand All @@ -8,6 +9,7 @@ import {

const completion: ApidomCompletionItem[] = [
...completion0_1_0Items,
...completion0_2_0Items,
...completionLatestItems,
{
label: 'bindingVersion',
Expand All @@ -18,7 +20,7 @@ const completion: ApidomCompletionItem[] = [
insertTextFormat: 2,
documentation: {
kind: 'markdown',
value: 'The version of this binding. If omitted, "0.1.0" MUST be assumed.',
value: '`string`\n\\\n\\\nThe version of this binding. If omitted, "0.2.0" MUST be assumed.',
},
},
{
Expand All @@ -30,6 +32,15 @@ const completion: ApidomCompletionItem[] = [
type: CompletionType.VALUE,
insertTextFormat: 2,
},
{
target: 'bindingVersion',
label: '0.2.0',
insertText: '0.2.0',
kind: 12,
format: CompletionFormat.QUOTED_FORCED,
type: CompletionType.VALUE,
insertTextFormat: 2,
},
];

export default completion;
Loading
Loading