Skip to content

Commit

Permalink
Update metadata.validate
Browse files Browse the repository at this point in the history
Update `metadata.validate` so that it is
adjusted to the error representation in
Pydantic V2
  • Loading branch information
candleindark committed Dec 12, 2023
1 parent 328cefa commit 00f0e91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dandischema/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 00f0e91

Please sign in to comment.