diff --git a/packages/apidom-ls/src/config/openapi/response/lint/allowed-fields-3-1.ts b/packages/apidom-ls/src/config/openapi/response/lint/allowed-fields-3-1.ts new file mode 100644 index 0000000000..a240ab9863 --- /dev/null +++ b/packages/apidom-ls/src/config/openapi/response/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: [['description', 'headers', 'content', 'links'], '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/response/lint/index.ts b/packages/apidom-ls/src/config/openapi/response/lint/index.ts index 905b783b5f..6941082d07 100644 --- a/packages/apidom-ls/src/config/openapi/response/lint/index.ts +++ b/packages/apidom-ls/src/config/openapi/response/lint/index.ts @@ -1,4 +1,5 @@ import allowedFields3_0Lint from './allowed-fields-3-0'; +import allowedFields3_1Lint from './allowed-fields-3-1'; import descriptionTypeLint from './description--type'; import descriptionRequiredLint from './description--required'; import headersValuesTypeLint from './headers--values-type'; @@ -12,6 +13,7 @@ const lints = [ contentValuesTypeLint, linksValuesTypeLint, allowedFields3_0Lint, + allowedFields3_1Lint, ]; export default lints;