diff --git a/src/specifications/dream-lock-schema.json b/src/specifications/dream-lock-schema.json index 098bc638..bdb964cc 100644 --- a/src/specifications/dream-lock-schema.json +++ b/src/specifications/dream-lock-schema.json @@ -97,8 +97,8 @@ }, "then": { "properties": { - "rootName": { "type": "string" }, - "rootVersion": { "type": "string" }, + "rootName": { "type": ["string", "null"] }, + "rootVersion": { "type": ["string", "null"] }, "path": { "type": "string" }, "type": { "type": "string" }, "dir": { "type": "string" } diff --git a/src/utils/default.nix b/src/utils/default.nix index 42a6f89a..0c06cb08 100644 --- a/src/utils/default.nix +++ b/src/utils/default.nix @@ -232,6 +232,12 @@ in | python3 ${../apps/cli/format-dream-lock.py} \ | sponge $dreamLockPath + # validate dream-lock.json against jsonschema + ${python3.pkgs.jsonschema}/bin/jsonschema \ + --instance $dreamLockPath \ + --output pretty \ + ${../specifications/dream-lock-schema.json} + # add dream-lock.json to git if git rev-parse --show-toplevel &>/dev/null; then echo "adding file to git: $dreamLockPath"