Files
clan-core/lib/jsonschema/example-schema.json
Valentin Gagarin 6a2e81373c lib/jsonschema: render defaults for submodule options
this relaxes the constraint that options of type `submodule` are always
required, and will render benign default values.
2025-04-16 16:55:46 +02:00

139 lines
3.8 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$exportedModuleInfo": { "path": [] },
"type": "object",
"additionalProperties": false,
"required": ["services", "userModules"],
"properties": {
"name": {
"$exportedModuleInfo": { "path": ["name"] },
"type": "string",
"default": "John Doe",
"description": "The name of the user"
},
"age": {
"$exportedModuleInfo": { "path": ["age"] },
"type": "integer",
"default": 42,
"description": "The age of the user"
},
"isAdmin": {
"$exportedModuleInfo": { "path": ["isAdmin"] },
"type": "boolean",
"default": false,
"description": "Is the user an admin?"
},
"kernelModules": {
"$exportedModuleInfo": { "path": ["kernelModules"] },
"type": "array",
"items": {
"$exportedModuleInfo": { "path": ["kernelModules"] },
"type": "string"
},
"default": ["nvme", "xhci_pci", "ahci"],
"description": "A list of enabled kernel modules"
},
"userIds": {
"$exportedModuleInfo": { "path": ["userIds"] },
"type": "object",
"default": {
"horst": 1,
"peter": 2,
"albrecht": 3
},
"additionalProperties": {
"$exportedModuleInfo": { "path": ["userIds"] },
"type": "integer"
},
"description": "Some attributes"
},
"userModules": {
"$exportedModuleInfo": { "path": ["userModules"] },
"type": "object",
"additionalProperties": {
"$exportedModuleInfo": { "path": ["userModules", "<name>"] },
"additionalProperties": false,
"type": "object",
"properties": {
"foo": {
"$exportedModuleInfo": {
"path": ["userModules", "<name>", "foo"]
},
"type": [
"boolean",
"integer",
"number",
"string",
"array",
"object",
"null"
]
}
},
"required": ["foo"]
}
},
"colour": {
"$exportedModuleInfo": { "path": ["colour"] },
"default": "red",
"description": "The colour of the user",
"enum": ["red", "blue", "green"]
},
"services": {
"$exportedModuleInfo": { "path": ["services"] },
"type": "object",
"additionalProperties": false,
"properties": {
"opt": {
"$exportedModuleInfo": { "path": ["services", "opt"] },
"type": "string",
"default": "foo",
"description": "A submodule option"
}
}
},
"programs": {
"$exportedModuleInfo": { "path": ["programs"] },
"type": "object",
"additionalProperties": false,
"properties": {
"opt": {
"$exportedModuleInfo": { "path": ["programs", "opt"] },
"type": "string",
"default": "bar",
"description": "Another submodule option"
}
},
"default": {}
},
"destinations": {
"$exportedModuleInfo": { "path": ["destinations"] },
"additionalProperties": {
"$exportedModuleInfo": { "path": ["destinations", "<name>"] },
"properties": {
"name": {
"$exportedModuleInfo": {
"path": ["destinations", "<name>", "name"]
},
"default": "name",
"description": "the name of the backup job",
"type": "string"
},
"repo": {
"$exportedModuleInfo": {
"path": ["destinations", "<name>", "repo"]
},
"description": "the borgbackup repository to backup to",
"type": "string"
}
},
"required": ["repo"],
"additionalProperties": false,
"type": "object"
},
"default": {},
"type": "object"
}
}
}