Skip to content

Commit ecfeac5

Browse files
authored
fix(ls): provide spec extension link rule for Discriminator (#2211)
This change is specific to OpenAPI 3.1.0. Refs #2061
1 parent 8602f74 commit ecfeac5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import ApilintCodes from '../../../codes';
2+
import { LinterMeta } from '../../../../apidom-language-types';
3+
4+
// eslint-disable-next-line @typescript-eslint/naming-convention
5+
const allowedFields3_1Lint: LinterMeta = {
6+
code: ApilintCodes.NOT_ALLOWED_FIELDS,
7+
source: 'apilint',
8+
message: 'Object includes not allowed fields',
9+
severity: 1,
10+
linterFunction: 'allowedFields',
11+
linterParams: [['propertyName', 'mapping'], 'x-'],
12+
marker: 'key',
13+
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
14+
};
15+
16+
export default allowedFields3_1Lint;

packages/apidom-ls/src/config/openapi/discriminator/lint/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import allowedFields3_0Lint from './allowed-fields-3-0';
2+
import allowedFields3_1Lint from './allowed-fields-3-1';
23
import propertyNameTypeLint from './property-name--type';
34
import propertyNameRequiredLint from './property-name--required';
45
import mappingTypeLint from './mapping--type';
@@ -8,6 +9,7 @@ const lints = [
89
propertyNameRequiredLint,
910
mappingTypeLint,
1011
allowedFields3_0Lint,
12+
allowedFields3_1Lint,
1113
];
1214

1315
export default lints;

0 commit comments

Comments
 (0)