From f9bba625241b53d1e19fcbb185a42ab179940b43 Mon Sep 17 00:00:00 2001 From: Isaac To Date: Mon, 18 Nov 2024 17:08:18 -0800 Subject: [PATCH] fix: update `"properties"` and `"required"` keys of JSON schema This is needed to handle the case in which the keys are newly added --- dandischema/models.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dandischema/models.py b/dandischema/models.py index 7f67c448..7e80baa3 100644 --- a/dandischema/models.py +++ b/dandischema/models.py @@ -116,6 +116,11 @@ def add_context(json_schema: dict) -> None: } required.append(context_key) + # Update the schema + # This is needed to handle the case in which the keys are newly added + json_schema["properties"] = properties + json_schema["required"] = required + class AccessType(Enum): """An enumeration of access status options"""