From e3cbbe9bcc2e592b2b11c19b6dddcb8abc8f332b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Gorej?= Date: Wed, 31 Jan 2024 13:51:02 +0100 Subject: [PATCH] fix(ls): allow AsyncAPI 2.0 Schema Object to be Boolean JSON Schema (#3766) Refs #3765 --- .../anypointmq/message-binding/lint/0-0-1/headers--type.ts | 4 ++-- .../anypointmq/message-binding/lint/latest/headers--type.ts | 4 ++-- .../bindings/http/message-binding/lint/0-1-0/headers--type.ts | 4 ++-- .../http/message-binding/lint/latest/headers--type.ts | 4 ++-- .../bindings/http/operation-binding/lint/0-1-0/query--type.ts | 4 ++-- .../http/operation-binding/lint/latest/query--type.ts | 4 ++-- .../bindings/ws/channel-binding/lint/0-1-0/headers--type.ts | 4 ++-- .../bindings/ws/channel-binding/lint/0-1-0/query--type.ts | 4 ++-- .../bindings/ws/channel-binding/lint/latest/headers--type.ts | 4 ++-- .../bindings/ws/channel-binding/lint/latest/query--type.ts | 4 ++-- .../src/config/asyncapi/message-trait/lint/headers--type.ts | 4 ++-- .../src/config/asyncapi/message/lint/headers--type.ts | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-0-1/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-0-1/headers--type.ts index 8aa242629..6a7dab6ca 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-0-1/headers--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/0-0-1/headers--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const headersTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_MESSAGE_BINDING_FIELD_HEADERS_TYPE, source: 'apilint', - message: 'headers must be an object', + message: 'headers must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'headers', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/latest/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/latest/headers--type.ts index 2722e0741..b07c0f4b5 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/latest/headers--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/anypointmq/message-binding/lint/latest/headers--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const headersTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_ANYPOINTMQ_MESSAGE_BINDING_FIELD_HEADERS_TYPE, source: 'apilint', - message: 'headers must be an object', + message: 'headers must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'headers', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/http/message-binding/lint/0-1-0/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/http/message-binding/lint/0-1-0/headers--type.ts index 412b7ef42..7dc1737ec 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/http/message-binding/lint/0-1-0/headers--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/http/message-binding/lint/0-1-0/headers--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const headersTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_HTTP_MESSAGE_BINDING_FIELD_HEADERS_TYPE, source: 'apilint', - message: 'headers must be an object', + message: 'headers must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'headers', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/http/message-binding/lint/latest/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/http/message-binding/lint/latest/headers--type.ts index 7f575c1f3..9bab321f8 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/http/message-binding/lint/latest/headers--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/http/message-binding/lint/latest/headers--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const headersTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_HTTP_MESSAGE_BINDING_FIELD_HEADERS_TYPE, source: 'apilint', - message: 'headers must be an object', + message: 'headers must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'headers', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/http/operation-binding/lint/0-1-0/query--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/http/operation-binding/lint/0-1-0/query--type.ts index 182c12552..0a0ab6814 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/http/operation-binding/lint/0-1-0/query--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/http/operation-binding/lint/0-1-0/query--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const queryTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_HTTP_OPERATION_BINDING_FIELD_QUERY_TYPE, source: 'apilint', - message: 'query must be an object', + message: 'query must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'query', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/http/operation-binding/lint/latest/query--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/http/operation-binding/lint/latest/query--type.ts index 753176155..d402f6117 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/http/operation-binding/lint/latest/query--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/http/operation-binding/lint/latest/query--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const queryTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_HTTP_OPERATION_BINDING_FIELD_QUERY_TYPE, source: 'apilint', - message: 'query must be an object', + message: 'query must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'query', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/0-1-0/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/0-1-0/headers--type.ts index 28c048f95..843a2b428 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/0-1-0/headers--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/0-1-0/headers--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const headersTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_WEB_SOCKET_CHANNEL_BINDING_FIELD_HEADERS_TYPE, source: 'apilint', - message: 'headers must be an object', + message: 'headers must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'headers', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/0-1-0/query--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/0-1-0/query--type.ts index c13f513d7..2bc5fbaae 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/0-1-0/query--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/0-1-0/query--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const queryTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_WEB_SOCKET_CHANNEL_BINDING_FIELD_QUERY_TYPE, source: 'apilint', - message: 'query must be an object', + message: 'query must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'query', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/latest/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/latest/headers--type.ts index e572ab0cd..105d5d1a5 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/latest/headers--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/latest/headers--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const headersTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_WEB_SOCKET_CHANNEL_BINDING_FIELD_HEADERS_TYPE, source: 'apilint', - message: 'headers must be an object', + message: 'headers must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'headers', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/latest/query--type.ts b/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/latest/query--type.ts index 5af40a64a..af7160c6c 100644 --- a/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/latest/query--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/bindings/ws/channel-binding/lint/latest/query--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../../../../apidom-language-types'; const queryTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_WEB_SOCKET_CHANNEL_BINDING_FIELD_QUERY_TYPE, source: 'apilint', - message: 'query must be an object', + message: 'query must be an object or a boolean JSON schema', severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'query', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/message-trait/lint/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/message-trait/lint/headers--type.ts index b22c65ffe..2bd48253c 100644 --- a/packages/apidom-ls/src/config/asyncapi/message-trait/lint/headers--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/message-trait/lint/headers--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../apidom-language-types'; const headersTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_MESSAGE_TRAIT_FIELD_HEADERS_TYPE, source: 'apilint', - message: "'headers' must be a schema object", + message: "'headers' must be a schema object or a boolean JSON schema", severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'headers', data: {}, diff --git a/packages/apidom-ls/src/config/asyncapi/message/lint/headers--type.ts b/packages/apidom-ls/src/config/asyncapi/message/lint/headers--type.ts index 1861d2da1..f335add37 100644 --- a/packages/apidom-ls/src/config/asyncapi/message/lint/headers--type.ts +++ b/packages/apidom-ls/src/config/asyncapi/message/lint/headers--type.ts @@ -6,10 +6,10 @@ import { LinterMeta } from '../../../../apidom-language-types'; const headersTypeLint: LinterMeta = { code: ApilintCodes.ASYNCAPI2_MESSAGE_FIELD_HEADERS_TYPE, source: 'apilint', - message: "'headers' must be a schema object", + message: "'headers' must be a schema object or a boolean JSON schema", severity: DiagnosticSeverity.Error, linterFunction: 'apilintElementOrClass', - linterParams: [['schema']], + linterParams: [['schema', 'boolean']], marker: 'value', target: 'headers', data: {},