jsonschema: dont export defaultText as default

This commit is contained in:
Johannes Kirschbauer
2024-11-21 14:11:29 +01:00
committed by hsjobeki
parent 28f907cc85
commit 6808f0a59f

View File

@@ -72,7 +72,8 @@ rec {
{ }
else if opt ? defaultText then
{
default = "<thunk>";
# dont add default to jsonschema. It seems to alter the type
# default = "<thunk>";
}
else
lib.optionalAttrs (opt ? default) {
@@ -93,10 +94,17 @@ rec {
};
makeModuleInfo =
{ path }:
{
"$exportedModuleInfo" = {
path,
defaultText ? null,
}:
{
"$exportedModuleInfo" =
{
inherit path;
}
// lib.optionalAttrs (defaultText != null) {
inherit defaultText;
};
};
@@ -172,6 +180,7 @@ rec {
};
exposedModuleInfo = makeModuleInfo {
path = option.loc;
defaultText = option.defaultText or null;
};
in
# either type