def _object_arg(value):
    """
    Validates the value of the optional object argument.

    :raises ValueError: If value is not None, 'full' or 'summary'.
    :param value: Argument value.
    :return: Validated value.
    """
    if value in [None, 'full', 'summary']:
        return value
    raise ValueError("Must be either 'full' or 'summary'.")
