jsonschema: support mdDoc description
This commit is contained in:
@@ -61,7 +61,7 @@ rec {
|
||||
inherit (option) default;
|
||||
};
|
||||
description = lib.optionalAttrs (option ? description) {
|
||||
inherit (option) description;
|
||||
description = option.description.text or option.description;
|
||||
};
|
||||
in
|
||||
|
||||
@@ -186,8 +186,10 @@ rec {
|
||||
in
|
||||
default // description // {
|
||||
type = "array";
|
||||
items = parseOption nestedOption;
|
||||
}
|
||||
// (lib.optionalAttrs (! isExcludedOption nestedOption) {
|
||||
items = parseOption nestedOption;
|
||||
})
|
||||
|
||||
# parse list of unspecified
|
||||
else if
|
||||
|
||||
@@ -39,6 +39,28 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
testDescriptionIsAttrs =
|
||||
let
|
||||
evaledConfig = lib.evalModules {
|
||||
modules = [{
|
||||
options.opt = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = {
|
||||
_type = "mdDoc";
|
||||
text = description;
|
||||
};
|
||||
};
|
||||
}];
|
||||
};
|
||||
in
|
||||
{
|
||||
expr = slib.parseOption evaledConfig.options.opt;
|
||||
expected = {
|
||||
type = "boolean";
|
||||
inherit description;
|
||||
};
|
||||
};
|
||||
|
||||
testBool =
|
||||
let
|
||||
default = false;
|
||||
|
||||
Reference in New Issue
Block a user