Skip to content

Commit 434bd92

Browse files
committed
feat(ls): finalize support for OpenAPI 3.0.x Spec Ext lint rules
Refs #2033
1 parent af07fd3 commit 434bd92

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

packages/apidom-ls/src/config/openapi/discriminator/lint/allowed-fields-3-0.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ const allowedFields3_0Lint: LinterMeta = {
1010
linterFunction: 'allowedFields',
1111
linterParams: [['propertyName', 'mapping']],
1212
marker: 'key',
13+
targetSpecs: [
14+
{ namespace: 'openapi', version: '3.0.0' },
15+
{ namespace: 'openapi', version: '3.0.1' },
16+
{ namespace: 'openapi', version: '3.0.2' },
17+
{ namespace: 'openapi', version: '3.0.3' },
18+
],
1319
};
1420

1521
export default allowedFields3_0Lint;

packages/apidom-ls/src/config/openapi/paths/lint/keys--pattern.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { LinterMeta } from '../../../../apidom-language-types';
44
const keysPatternLint: LinterMeta = {
55
code: ApilintCodes.OPENAPI3_0_PATHS_KEYS_PATTERN,
66
source: 'apilint',
7-
message: 'Paths Object keys must match the regular expression: `^/`',
7+
message: 'Paths Object keys must match the regular expression: `^(/|x-)`',
88
severity: 1,
99
linterFunction: 'apilintKeysRegex',
10-
linterParams: ['^/'],
10+
linterParams: ['^(/|x-)'],
1111
marker: 'key',
1212
data: {},
1313
};

0 commit comments

Comments
 (0)