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