Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/apidom-ls/src/config/codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,8 @@ enum ApilintCodes {

OPENAPI3_1_REFERENCE = 7040000,
OPENAPI3_1_REFERENCE_FIELD_$REF_ALLOWED_SIBLINGS = 7040100,
OPENAPI3_1_REFERENCE_FIELD_DESCRIPTION_TYPE = 7040200,
OPENAPI3_1_REFERENCE_FIELD_SUMMARY_TYPE = 7040300,

OPENAPI3_1_SECURITY_SCHEME = 7050000,
OPENAPI3_1_SECURITY_SCHEME_FIELD_TYPE_EQUALS = 7050100,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ApilintCodes from '../../../codes';
import { LinterMeta } from '../../../../apidom-language-types';

// eslint-disable-next-line @typescript-eslint/naming-convention
const $refNoSiblings3_0Lint: LinterMeta = {
const $ref3_0NoSiblingsLint: LinterMeta = {
code: ApilintCodes.OPENAPI3_0_REFERENCE_FIELD_$REF_NO_SIBLINGS,
source: 'apilint',
message: 'All other properties in a "$ref" object are ignored',
Expand Down Expand Up @@ -36,4 +36,4 @@ const $refNoSiblings3_0Lint: LinterMeta = {
],
};

export default $refNoSiblings3_0Lint;
export default $ref3_0NoSiblingsLint;
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ApilintCodes from '../../../codes';
import { LinterMeta } from '../../../../apidom-language-types';

// eslint-disable-next-line @typescript-eslint/naming-convention
const $refAllowedSiblings3_1Lint: LinterMeta = {
const $ref3_1AllowedSiblingsLint: LinterMeta = {
code: ApilintCodes.OPENAPI3_1_REFERENCE_FIELD_$REF_ALLOWED_SIBLINGS,
source: 'apilint',
message:
Expand All @@ -23,4 +23,4 @@ const $refAllowedSiblings3_1Lint: LinterMeta = {
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
};

export default $refAllowedSiblings3_1Lint;
export default $ref3_1AllowedSiblingsLint;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { DiagnosticSeverity } from 'vscode-languageserver-types';

import ApilintCodes from '../../../codes';
import { LinterMeta } from '../../../../apidom-language-types';

// eslint-disable-next-line @typescript-eslint/naming-convention
const description3_1TypeLint: LinterMeta = {
code: ApilintCodes.OPENAPI3_1_REFERENCE_FIELD_DESCRIPTION_TYPE,
source: 'apilint',
message: 'description must be a string',
severity: DiagnosticSeverity.Error,
linterFunction: 'apilintType',
linterParams: ['string'],
marker: 'value',
target: 'description',
data: {},
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
};

export default description3_1TypeLint;
14 changes: 11 additions & 3 deletions packages/apidom-ls/src/config/openapi/reference/lint/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import $refFormatURILint from './$ref--format-uri';
import $refNoSiblings3_0Lint from './$ref--no-siblings-3-0';
import $refAllowedSiblings3_1Lint from './$ref--allowed-siblings-3-1';
import $ref3_0NoSiblingsLint from './$ref-3-0--no-siblings';
import $ref3_1AllowedSiblingsLint from './$ref-3-1--allowed-siblings';
import description3_1TypeLint from './description-3-1--type';
import summary3_1TypeLint from './summary-3-1--type';

const lints = [$refFormatURILint, $refNoSiblings3_0Lint, $refAllowedSiblings3_1Lint];
const lints = [
$refFormatURILint,
$ref3_0NoSiblingsLint,
$ref3_1AllowedSiblingsLint,
description3_1TypeLint,
summary3_1TypeLint,
];

export default lints;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { DiagnosticSeverity } from 'vscode-languageserver-types';

import ApilintCodes from '../../../codes';
import { LinterMeta } from '../../../../apidom-language-types';

// eslint-disable-next-line @typescript-eslint/naming-convention
const summary3_1TypeLint: LinterMeta = {
code: ApilintCodes.OPENAPI3_1_REFERENCE_FIELD_SUMMARY_TYPE,
source: 'apilint',
message: 'summary must be a string',
severity: DiagnosticSeverity.Error,
linterFunction: 'apilintType',
linterParams: ['string'],
marker: 'value',
target: 'summary',
data: {},
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
};

export default summary3_1TypeLint;