Serializes the given value using the given serializer.
        :param to_serialize: the value to deserialize
        :param serializer_cls: the type of serializer to use
        :return: serialized value

def _serialize_property_value(self, to_serialize: Any, serializer_cls: Type) -> Any:
        """
        Serializes the given value using the given serializer.
        :param to_serialize: the value to deserialize
        :param serializer_cls: the type of serializer to use
        :return: serialized value
        """
        serializer = self._create_serializer_of_type_with_cache(serializer_cls)
        assert serializer is not None
        return serializer.serialize(to_serialize)