from typing import List
from typing import Union


def _parse_field_names(fields: List[Union[str, dict]]) -> List[str]:
    """Parse field names.

    Args:
        fields: Either field names or field descriptors with a `name` key.

    Returns:
        Field names.
    """
    return [field if isinstance(field, str) else field["name"] for field in fields]