diff --git a/lib/jsonschema/default.nix b/lib/jsonschema/default.nix index eb5bcd94d..53dbb9e05 100644 --- a/lib/jsonschema/default.nix +++ b/lib/jsonschema/default.nix @@ -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 diff --git a/lib/jsonschema/test_parseOption.nix b/lib/jsonschema/test_parseOption.nix index 5ce3d69be..a20b329eb 100644 --- a/lib/jsonschema/test_parseOption.nix +++ b/lib/jsonschema/test_parseOption.nix @@ -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;