Skip to content

Commit

Permalink
Actually, descriptor does support validation 🏭️
Browse files Browse the repository at this point in the history
  • Loading branch information
Kezzsim committed Feb 2, 2024
1 parent 795e415 commit 35724ac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions databroker/mongo_normalized.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@ async def update_metadata(self, metadata=None, specs=None):
raise NotImplementedError('Update_metadata method requires descriptors.')
# Update descriptors
for descriptor in metadata["descriptors"]:
try:
schema_validators[DocumentNames.descriptor].validate(descriptor)
except ValidationError as err:
raise
self.serializer.update("descriptor", descriptor)


Expand Down

0 comments on commit 35724ac

Please sign in to comment.