Skip to content

Commit

Permalink
# Added extensions keywords
Browse files Browse the repository at this point in the history
Signed-off-by: Theo Truong <[email protected]>
  • Loading branch information
nhtruong committed May 16, 2024
1 parent 2c6c468 commit 9f68afe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/schemas/cat.nodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@ components:
type: string
master:
description: |-
(Deprecated in 2.0.0. To promote inclusive language, use 'cluster_manager' instead.)
Indicates whether the node is the elected master node.
Returned values include `*`(elected master) and `-`(not elected master).
type: string
x-version-deprecated: 2.0.0
x-deprecation-message: To promote inclusive language, use 'cluster_manager' instead.
name:
$ref: '_common.yaml#/components/schemas/Name'
completion.size:
Expand Down
8 changes: 8 additions & 0 deletions tools/src/linter/SchemasValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ const IGNORED_ERROR_PREFIXES = [
'discriminator: oneOf subschemas' // known bug in ajv: https://github.com/ajv-validator/ajv/issues/2281
]

const ADDITIONAL_KEYWORDS = [
'x-version-added',
'x-version-deprecated',
'x-version-removed',
'x-deprecation-message',

Check failure on line 15 in tools/src/linter/SchemasValidator.ts

View workflow job for this annotation

GitHub Actions / tools-tests

Unexpected trailing comma
]

export default class SchemasValidator {
root_folder: string
spec: Record<string, any> = {}
Expand All @@ -17,6 +24,7 @@ export default class SchemasValidator {
this.root_folder = root_folder
this.ajv = new AJV({ strict: true, discriminator: true })
addFormats(this.ajv)
for(const keyword of ADDITIONAL_KEYWORDS) this.ajv.addKeyword(keyword)

Check failure on line 27 in tools/src/linter/SchemasValidator.ts

View workflow job for this annotation

GitHub Actions / tools-tests

Expected space(s) after "for"
}

validate (): ValidationError[] {
Expand Down

0 comments on commit 9f68afe

Please sign in to comment.