-
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(apidom-ls): fix schema rules for boolean
- Loading branch information
Showing
56 changed files
with
478 additions
and
42 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
22 changes: 22 additions & 0 deletions
22
.../apidom-ls/src/config/common/schema/lint/additional-items--type-openapi-3-1-asyncapi-2.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 { DiagnosticSeverity } from 'vscode-languageserver-types'; | ||
|
||
import ApilintCodes from '../../../codes'; | ||
import { LinterMeta } from '../../../../apidom-language-types'; | ||
import { AsyncAPI2 } from '../../../asyncapi/target-specs'; | ||
import { OpenAPI31 } from '../../../openapi/target-specs'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const additionalItemsTypeOpenAPI3_1_AsyncAPI2Lint: LinterMeta = { | ||
code: ApilintCodes.SCHEMA_ADDITIONALITEMS, | ||
source: 'apilint', | ||
message: 'additionalItems must be a schema', | ||
severity: DiagnosticSeverity.Error, | ||
linterFunction: 'apilintElementOrClass', | ||
linterParams: ['schema', 'boolean'], | ||
marker: 'value', | ||
target: 'additionalItems', | ||
data: {}, | ||
targetSpecs: [...OpenAPI31, ...AsyncAPI2], | ||
}; | ||
|
||
export default additionalItemsTypeOpenAPI3_1_AsyncAPI2Lint; |
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
22 changes: 22 additions & 0 deletions
22
packages/apidom-ls/src/config/common/schema/lint/all-of--type-openapi-3-1-asyncapi-2.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 { DiagnosticSeverity } from 'vscode-languageserver-types'; | ||
|
||
import ApilintCodes from '../../../codes'; | ||
import { LinterMeta } from '../../../../apidom-language-types'; | ||
import { AsyncAPI2 } from '../../../asyncapi/target-specs'; | ||
import { OpenAPI31 } from '../../../openapi/target-specs'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const allOfTypeOpenAPI3_1_AsyncAPI2Lint: LinterMeta = { | ||
code: ApilintCodes.SCHEMA_ALLOF, | ||
source: 'apilint', | ||
message: 'allOf must be a non-empty array of schemas', | ||
severity: DiagnosticSeverity.Error, | ||
linterFunction: 'apilintArrayOfElementsOrClasses', | ||
linterParams: [['schema', 'boolean'], true], | ||
marker: 'key', | ||
target: 'allOf', | ||
data: {}, | ||
targetSpecs: [...OpenAPI31, ...AsyncAPI2], | ||
}; | ||
|
||
export default allOfTypeOpenAPI3_1_AsyncAPI2Lint; |
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
22 changes: 22 additions & 0 deletions
22
packages/apidom-ls/src/config/common/schema/lint/any-of--type-openapi-3-1-asyncapi-2.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 { DiagnosticSeverity } from 'vscode-languageserver-types'; | ||
|
||
import ApilintCodes from '../../../codes'; | ||
import { LinterMeta } from '../../../../apidom-language-types'; | ||
import { AsyncAPI2 } from '../../../asyncapi/target-specs'; | ||
import { OpenAPI31 } from '../../../openapi/target-specs'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const anyOfTypeOpenAPI3_1_AsyncAPI2Lint: LinterMeta = { | ||
code: ApilintCodes.SCHEMA_ANYOF, | ||
source: 'apilint', | ||
message: 'anyOf must be a non-empty array of schemas', | ||
severity: DiagnosticSeverity.Error, | ||
linterFunction: 'apilintArrayOfElementsOrClasses', | ||
linterParams: [['schema', 'boolean'], true], | ||
marker: 'key', | ||
target: 'anyOf', | ||
data: {}, | ||
targetSpecs: [...OpenAPI31, ...AsyncAPI2], | ||
}; | ||
|
||
export default anyOfTypeOpenAPI3_1_AsyncAPI2Lint; |
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
22 changes: 22 additions & 0 deletions
22
packages/apidom-ls/src/config/common/schema/lint/contains--type-openapi-3-1-asyncapi-2.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 { DiagnosticSeverity } from 'vscode-languageserver-types'; | ||
|
||
import ApilintCodes from '../../../codes'; | ||
import { LinterMeta } from '../../../../apidom-language-types'; | ||
import { AsyncAPI2 } from '../../../asyncapi/target-specs'; | ||
import { OpenAPI31 } from '../../../openapi/target-specs'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const containsTypeOpenAPI3_1_AsyncAPI2Lint: LinterMeta = { | ||
code: ApilintCodes.SCHEMA_CONTAINS, | ||
source: 'apilint', | ||
message: 'contains must be a schema', | ||
severity: DiagnosticSeverity.Error, | ||
linterFunction: 'apilintElementOrClass', | ||
linterParams: ['schema', 'boolean'], | ||
marker: 'value', | ||
target: 'contains', | ||
data: {}, | ||
targetSpecs: [...OpenAPI31, ...AsyncAPI2], | ||
}; | ||
|
||
export default containsTypeOpenAPI3_1_AsyncAPI2Lint; |
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
22 changes: 22 additions & 0 deletions
22
packages/apidom-ls/src/config/common/schema/lint/else--type-openapi-3-1-asyncapi-2.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 { DiagnosticSeverity } from 'vscode-languageserver-types'; | ||
|
||
import ApilintCodes from '../../../codes'; | ||
import { LinterMeta } from '../../../../apidom-language-types'; | ||
import { AsyncAPI2 } from '../../../asyncapi/target-specs'; | ||
import { OpenAPI31 } from '../../../openapi/target-specs'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const elseTypeOpenAPI3_1_AsyncAPI2Lint: LinterMeta = { | ||
code: ApilintCodes.SCHEMA_ELSE, | ||
source: 'apilint', | ||
message: '"else" must be a schema', | ||
severity: DiagnosticSeverity.Error, | ||
linterFunction: 'apilintElementOrClass', | ||
linterParams: ['schema', 'boolean'], | ||
marker: 'value', | ||
target: 'else', | ||
data: {}, | ||
targetSpecs: [...OpenAPI31, ...AsyncAPI2], | ||
}; | ||
|
||
export default elseTypeOpenAPI3_1_AsyncAPI2Lint; |
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
22 changes: 22 additions & 0 deletions
22
packages/apidom-ls/src/config/common/schema/lint/if--type-openapi-3-1-asyncapi-2.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 { DiagnosticSeverity } from 'vscode-languageserver-types'; | ||
|
||
import ApilintCodes from '../../../codes'; | ||
import { LinterMeta } from '../../../../apidom-language-types'; | ||
import { AsyncAPI2 } from '../../../asyncapi/target-specs'; | ||
import { OpenAPI31 } from '../../../openapi/target-specs'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const ifTypeOpenAPI3_1_AsyncAPI2Lint: LinterMeta = { | ||
code: ApilintCodes.SCHEMA_IF, | ||
source: 'apilint', | ||
message: 'if must be a schema', | ||
severity: DiagnosticSeverity.Error, | ||
linterFunction: 'apilintElementOrClass', | ||
linterParams: ['schema', 'boolean'], | ||
marker: 'value', | ||
target: 'if', | ||
data: {}, | ||
targetSpecs: [...OpenAPI31, ...AsyncAPI2], | ||
}; | ||
|
||
export default ifTypeOpenAPI3_1_AsyncAPI2Lint; |
Oops, something went wrong.