From 00f0e910a4bc0ddb4e0d0506de6255694ba21f2b Mon Sep 17 00:00:00 2001 From: Isaac To Date: Tue, 12 Dec 2023 12:49:43 -0800 Subject: [PATCH] Update `metadata.validate` Update `metadata.validate` so that it is adjusted to the error representation in Pydantic V2 --- dandischema/metadata.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dandischema/metadata.py b/dandischema/metadata.py index de7b12b..2da9779 100644 --- a/dandischema/metadata.py +++ b/dandischema/metadata.py @@ -211,7 +211,7 @@ def validate( except pydantic.ValidationError as exc: messages = [] for el in exc.errors(): - if not missing_ok or el["msg"] != "field required": + if not missing_ok or el["type"] != "missing": messages.append(el) if messages: raise PydanticValidationError(messages) # type: ignore[arg-type]