from pathlib import Path


def _represent_path(self, data: Path):
    """
    Serialize a `Path` object to a string.

    .. warning::
        Path("./aaa") serializes to "aaa"

    :param data: [description]
    :type data: pathlib.Path
    """
    return self.represent_scalar("tag:yaml.org,2002:str", str(data))