Skip to content

Commit

Permalink
fix(ls): provide spec extension link rule for Discriminator (#2211)
Browse files Browse the repository at this point in the history
This change is specific to OpenAPI 3.1.0.

Refs #2061
  • Loading branch information
char0n authored Oct 28, 2022
1 parent 8602f74 commit ecfeac5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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: [['propertyName', 'mapping'], 'x-'],
marker: 'key',
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
};

export default allowedFields3_1Lint;
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import allowedFields3_0Lint from './allowed-fields-3-0';
import allowedFields3_1Lint from './allowed-fields-3-1';
import propertyNameTypeLint from './property-name--type';
import propertyNameRequiredLint from './property-name--required';
import mappingTypeLint from './mapping--type';
Expand All @@ -8,6 +9,7 @@ const lints = [
propertyNameRequiredLint,
mappingTypeLint,
allowedFields3_0Lint,
allowedFields3_1Lint,
];

export default lints;

0 comments on commit ecfeac5

Please sign in to comment.