feat(jsonschema): add test for attrsof submodule
This commit is contained in:
@@ -40,6 +40,14 @@
|
||||
albrecht = 3;
|
||||
};
|
||||
};
|
||||
# attrs of submodule
|
||||
userModules = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule {
|
||||
options.foo = lib.mkOption { };
|
||||
}
|
||||
);
|
||||
};
|
||||
# list of str
|
||||
kernelModules = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"$exportedModuleInfo": { "path": [] },
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [ "services" ],
|
||||
"required": ["services", "userModules"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"$exportedModuleInfo": { "path": ["name"] },
|
||||
@@ -47,6 +47,32 @@
|
||||
},
|
||||
"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",
|
||||
|
||||
Reference in New Issue
Block a user