The encoder for this schema.
        Tries each encoder in order of the types specified for this schema.

def encode(self, value):
        """The encoder for this schema.
        Tries each encoder in order of the types specified for this schema.
        """
        if value is None and self._default is not None:
            value = self._default

        for encoder in self._encoders:
            try:
                return encoder(value)
            except ValueError as ex:
                pass

        raise ValueError('Value \'{}\' is invalid. {}'
                         .format(value, ex.message))