feat(jsonschema): remove 'default' if 'defaultText' is present

default is likely to contain an error thunk if defaultText is set
including it into $exportedModuleInfo makes it non-serializable
This commit is contained in:
Johannes Kirschbauer
2025-06-04 20:22:32 +02:00
parent dad55040ba
commit 7a7bcf68c6
2 changed files with 27 additions and 1 deletions

View File

@@ -100,9 +100,12 @@ rec {
defaultText ? null,
...
}@attrs:
let
sanitizedAttrs = removeAttrs attrs (lib.optionals (defaultText != null) [ "default" ]);
in
{
"$exportedModuleInfo" =
attrs
sanitizedAttrs
// {
inherit path required;
}