from typing import Union


def create_body_format(body: Union[dict, list]):
    """
    {
        "key1": "val1",
        "key2": {
            "key3": "val3"
        },
        "key4": [
            {
                "key5": "val5"
            },
            {
                "key5": "val51"
            },
        ],
        "key7": [
            "a",
            "b",
            "c"
        ]
    }

    ==>
    {
        "key1": "{key1}",
        "key2": {
            "key3": "{key3}"
        },
        "key4": [
            {
                "key5": "{key5}"
            }
        ],
        "key7": "{key7}"
    }
    """
    def format_value(d, o):
        for k, v in d.items():
            if isinstance(v, dict):
                o[k] = {}
                o[k] = format_value(v, o[k])
            elif isinstance(v, list) and len(v) > 0 and isinstance(v[0], dict):
                o[k] = [{}]
                o[k][0] = format_value(v[0], o[k][0])
            else:
                o[k] = '{' + k + '}'
        return o

    if isinstance(body, dict):
        return format_value(body, {})
    if isinstance(body, list) and len(body) > 0 and isinstance(body[0], dict):
        return [format_value(body[0], {})]

    return None