def validate_type()

in pulsar/schema/definition.py [0:0]


    def validate_type(self, name, val):
        if val is None and not self._required:
            return self.default()

        if not isinstance(val, self.__class__):
            raise TypeError("Invalid type '%s' for sub-record field '%s'. Expected: %s" % (
                type(val), name, _string_representation(self.__class__)))
        return val