diff --git a/packages/apidom-ls/src/config/common/schema/lint/type--equals-openapi-3-1--asyncapi-2.ts b/packages/apidom-ls/src/config/common/schema/lint/type--equals-openapi-3-1--asyncapi-2.ts index 7224e8c7a2..81519316a9 100644 --- a/packages/apidom-ls/src/config/common/schema/lint/type--equals-openapi-3-1--asyncapi-2.ts +++ b/packages/apidom-ls/src/config/common/schema/lint/type--equals-openapi-3-1--asyncapi-2.ts @@ -9,7 +9,8 @@ import { OpenAPI31 } from '../../../openapi/target-specs.ts'; const typeEqualsOpenAPI3_1__AsyncAPI2Lint: LinterMeta = { code: ApilintCodes.SCHEMA_TYPE, source: 'apilint', - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: DiagnosticSeverity.Error, linterFunction: 'apilintValueOrArray', linterParams: [['null', 'boolean', 'object', 'array', 'number', 'string', 'integer'], true], diff --git a/packages/apidom-ls/src/config/common/schema/lint/type--equals.ts b/packages/apidom-ls/src/config/common/schema/lint/type--equals.ts index 77c8d00b33..860ca742bf 100644 --- a/packages/apidom-ls/src/config/common/schema/lint/type--equals.ts +++ b/packages/apidom-ls/src/config/common/schema/lint/type--equals.ts @@ -7,7 +7,8 @@ import { OpenAPI2, OpenAPI30 } from '../../../openapi/target-specs.ts'; const typeEqualsLint: LinterMeta = { code: ApilintCodes.SCHEMA_TYPE, source: 'apilint', - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: array, boolean, integer, number, object, string', severity: DiagnosticSeverity.Error, linterFunction: 'apilintValueOrArray', linterParams: [['boolean', 'object', 'array', 'number', 'string', 'integer']], diff --git a/packages/apidom-ls/test/fixtures/expected/apidom-ls-async/sample-api-async-validation-2.0.0.json b/packages/apidom-ls/test/fixtures/expected/apidom-ls-async/sample-api-async-validation-2.0.0.json index 74f2407b71..3f13415f29 100644 --- a/packages/apidom-ls/test/fixtures/expected/apidom-ls-async/sample-api-async-validation-2.0.0.json +++ b/packages/apidom-ls/test/fixtures/expected/apidom-ls-async/sample-api-async-validation-2.0.0.json @@ -68,7 +68,7 @@ "character": 29 } }, - "message": "type must be one of allowed values", + "message": "should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null", "severity": 1, "code": 10001, "source": "apilint", @@ -77,51 +77,37 @@ { "message": "update to 'null'", "action": "updateValue", - "functionParams": [ - "null" - ] + "functionParams": ["null"] }, { "message": "update to 'boolean'", "action": "updateValue", - "functionParams": [ - "boolean" - ] + "functionParams": ["boolean"] }, { "message": "update to 'object'", "action": "updateValue", - "functionParams": [ - "object" - ] + "functionParams": ["object"] }, { "message": "update to 'array'", "action": "updateValue", - "functionParams": [ - "array" - ] + "functionParams": ["array"] }, { "message": "update to 'number'", "action": "updateValue", - "functionParams": [ - "null" - ] + "functionParams": ["null"] }, { "message": "update to 'string'", "action": "updateValue", - "functionParams": [ - "string" - ] + "functionParams": ["string"] }, { "message": "update to 'integer'", "action": "updateValue", - "functionParams": [ - "integer" - ] + "functionParams": ["integer"] } ] } diff --git a/packages/apidom-ls/test/validate.ts b/packages/apidom-ls/test/validate.ts index 397cbb5363..f13245bd27 100644 --- a/packages/apidom-ls/test/validate.ts +++ b/packages/apidom-ls/test/validate.ts @@ -288,7 +288,8 @@ describe('apidom-ls-validate', function () { character: 35, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -407,7 +408,8 @@ describe('apidom-ls-validate', function () { character: 29, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -525,7 +527,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -857,7 +860,8 @@ describe('apidom-ls-validate', function () { character: 35, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -1061,7 +1065,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -1198,7 +1203,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -1462,7 +1468,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -1628,7 +1635,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -1708,7 +1716,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -1788,7 +1797,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -1868,7 +1878,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -1948,7 +1959,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -2028,7 +2040,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint', @@ -2108,7 +2121,8 @@ describe('apidom-ls-validate', function () { character: 23, }, }, - message: 'type must be one of allowed values', + message: + 'should be equal to one of the allowed values allowedValues: boolean, object, array, number, string, integer, null', severity: 1, code: 10001, source: 'apilint',