Skip to content

Commit

Permalink
feat: Add a JSON schema defining the config file format
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebz committed Jul 12, 2024
1 parent 44e980a commit efcb4c5
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
45 changes: 45 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"RuleLevel": {
"type": "string",
"enum": [
"on",
"off",
"info",
"minor",
"major",
"critical",
"blocker"
]
},
"RuleOptions": {
"type": "object",
"properties": {
"level": {
"$ref": "#/$defs/RuleLevel"
},
"parameters": {
"additionalProperties": {
"type": "string"
}
}
}
}
},
"type": "object",
"properties": {
"rules": {
"additionalProperties": {
"oneOf": [
{
"$ref": "#/$defs/RuleLevel"
},
{
"$ref": "#/$defs/RuleOptions"
}
]
}
}
}
}
1 change: 1 addition & 0 deletions zpa-config-example.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "schema.json",
"rules": {
"EmptyBlock": "minor",
"ParsingError": "info",
Expand Down

0 comments on commit efcb4c5

Please sign in to comment.