diff --git a/yants.nix b/yants.nix index 3dfebfcf1..a00d08439 100644 --- a/yants.nix +++ b/yants.nix @@ -35,7 +35,8 @@ with builtins; let type = def."${field}"; checked = type.check fieldVal; in if checked then (current && true) - else (throw "Field ${field} is of type ${typeOf fieldVal}, but expected ${type.name}"); + else if isNull fieldVal then (throw "Missing required ${type.name} field '${field}'") + else (throw "Field ${field} is of type ${typeOf fieldVal}, but expected ${type.name}"); checkExtraneous = name: def: present: if (length present) == 0 then true diff --git a/z-structs.png b/z-structs.png index f46e15ade..fcbcf6415 100644 Binary files a/z-structs.png and b/z-structs.png differ