diff --git a/databroker/mongo_normalized.py b/databroker/mongo_normalized.py index 50af5f3f3..1681be0c8 100644 --- a/databroker/mongo_normalized.py +++ b/databroker/mongo_normalized.py @@ -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)