Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix(ruleset): [schema] remove redundant 'type' declarations with 'enu…
…m' in schemas

Signed-off-by: karan-palan <[email protected]>
  • Loading branch information
Karan-Palan committed Jul 1, 2025
commit cba5bab3ccdee63cf98e4249c607ee4fd05174d4
129 changes: 64 additions & 65 deletions rulesets/schemas/rule.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,30 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://quobix.com/vacuum/schemas/rule.schema.json",
"type": "object",
"additionalProperties": false,
"required": [ "given", "then" ],
"properties": {
"description": {
"id": {
"type": "string"
},
"howToFix": {
"description": {
"type": "string"
},
"id": {
"type": "string"
"type": {
"enum": [ "style", "validation" ],
"errorMessage": "allowed types are \"style\" and \"validation\""
},
"then": {
"anyOf": [
{
"$ref": "#/$defs/Then"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/Then"
}
}
]
},
"category": {
"oneOf": [
Expand All @@ -24,10 +38,10 @@
"id": {
"type": "string"
},
"name": {
"description": {
"type": "string"
},
"description": {
"name": {
"type": "string"
}
}
Expand All @@ -39,8 +53,8 @@
"format": "url",
"errorMessage": "must be a valid URL"
},
"recommended": {
"type": "boolean"
"formats": {
"$ref": "#/$defs/Formats"
},
"given": {
"oneOf": [
Expand All @@ -55,52 +69,45 @@
}
]
},
"howToFix": {
"type": "string"
},
"message": {
"type": "string"
},
"recommended": {
"type": "boolean"
},
"resolved": {
"type": "boolean"
},
"severity": {
"$ref": "#/$defs/Severity"
},
"message": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"type": "string"
},
"type": "array"
},
"formats": {
"$ref": "#/$defs/Formats"
},
"then": {
"anyOf": [
{
"$ref": "#/$defs/Then"
},
{
"items": {
"$ref": "#/$defs/Then"
},
"type": "array"
}
]
},
"type": {
"enum": ["style", "validation"],
"type": "string",
"errorMessage": "allowed types are \"style\" and \"validation\""
}
}
},
"required": ["given", "then"],
"additionalProperties": false,
"$defs": {
"DiagnosticSeverity": {
"enum": [ -1, 0, 1, 2, 3 ]
},
"Format": {
"$anchor": "format",
"spectral-runtime": "spectral-format",
"errorMessage": "must be a valid format"
"errorMessage": "must be a valid format",
"spectral-runtime": "spectral-format"
},
"DiagnosticSeverity": {
"enum": [-1, 0, 1, 2, 3]
"Formats": {
"$anchor": "formats",
"type": "array",
"items": {
"$ref": "#/$defs/Format"
},
"errorMessage": "must be an array of formats"
},
"Functions": {
"$anchor": "functions",
Expand All @@ -109,6 +116,21 @@
"type": "string"
}
},
"HumanReadableSeverity": {
"enum": [ "error", "warn", "info", "hint", "off" ]
},
"Severity": {
"$anchor": "severity",
"oneOf": [
{
"$ref": "#/$defs/DiagnosticSeverity"
},
{
"$ref": "#/$defs/HumanReadableSeverity"
}
],
"errorMessage": "the value has to be one of: 0, 1, 2, 3 or \"error\", \"warn\", \"info\", \"hint\", \"off\""
},
"Then": {
"type": "object",
"allOf": [
Expand All @@ -121,33 +143,10 @@
},
{
"type": "object",
"spectral-runtime": "ruleset-function",
"required": ["function"]
"required": [ "function" ],
"spectral-runtime": "ruleset-function"
}
]
},
"Formats": {
"$anchor": "formats",
"type": "array",
"items": {
"$ref": "#/$defs/Format"
},
"errorMessage": "must be an array of formats"
},
"HumanReadableSeverity": {
"enum": ["error", "warn", "info", "hint", "off"]
},
"Severity": {
"$anchor": "severity",
"oneOf": [
{
"$ref": "#/$defs/DiagnosticSeverity"
},
{
"$ref": "#/$defs/HumanReadableSeverity"
}
],
"errorMessage": "the value has to be one of: 0, 1, 2, 3 or \"error\", \"warn\", \"info\", \"hint\", \"off\""
}
}
}
Loading