diff --git a/packages/apidom-ls/src/config/openapi/example/lint/allowed-fields-3-1.ts b/packages/apidom-ls/src/config/openapi/example/lint/allowed-fields-3-1.ts new file mode 100644 index 0000000000..e3bcb05346 --- /dev/null +++ b/packages/apidom-ls/src/config/openapi/example/lint/allowed-fields-3-1.ts @@ -0,0 +1,22 @@ +import ApilintCodes from '../../../codes'; +import { LinterMeta } from '../../../../apidom-language-types'; + +// eslint-disable-next-line @typescript-eslint/naming-convention +const allowedFields3_1Lint: LinterMeta = { + code: ApilintCodes.NOT_ALLOWED_FIELDS, + source: 'apilint', + message: 'Object includes not allowed fields', + severity: 1, + linterFunction: 'allowedFields', + linterParams: [['summary', 'description', 'value', 'externalValue'], 'x-'], + marker: 'key', + conditions: [ + { + function: 'missingField', + params: ['$ref'], + }, + ], + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], +}; + +export default allowedFields3_1Lint; diff --git a/packages/apidom-ls/src/config/openapi/example/lint/index.ts b/packages/apidom-ls/src/config/openapi/example/lint/index.ts index 250a260b42..59320d9c2f 100644 --- a/packages/apidom-ls/src/config/openapi/example/lint/index.ts +++ b/packages/apidom-ls/src/config/openapi/example/lint/index.ts @@ -1,4 +1,5 @@ import allowedFields3_0Lint from './allowed-fields-3-0'; +import allowedFields3_1Lint from './allowed-fields-3-1'; import summaryTypeLint from './summary--type'; import descriptionTypeLint from './description--type'; import valueMutuallyExclusiveLint from './value--mutually-exclusive'; @@ -10,6 +11,7 @@ const lints = [ valueMutuallyExclusiveLint, externalValueFormatURILint, allowedFields3_0Lint, + allowedFields3_1Lint, ]; export default lints;