import json


def get_json_headers(path):
    """Return all field names encountered in the file."""

    keys = set()

    with open(path) as stream:
        rows = json.loads(stream.read())
        for row in rows:
            keys.update(set(row))
        return list(keys)