def Validate(self, schema, allow_extra_fields=False):
    assert schema, "A schema must be provided in order to validate."
    try:
      validictory.validate(self.dict, schema)
      if not allow_extra_fields:
        self._FindExtraFields(self.dict, schema, True)
      self.schema = schema
    except Exception as e:
      raise BadMessageException(e.message), None, sys.exc_info()[2]
Validate that the message conforms to the specified schema.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/base/message.py/Message.Validate