-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ls): provide OpenAPI 3.1 Response allowed fields link rule
Refs #2061
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
packages/apidom-ls/src/config/openapi/response/lint/allowed-fields-3-1.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters