from typing import MutableMapping


def reduce_schema(d):
    """
    Takes a jsonschema loaded as a dictionary and return a reduced structure
    ignoring everything apart from the structure it describes.
    """
    r = {}
    CONTAINS_KEYS = "properties"
    if CONTAINS_KEYS in d:
        for k, v in d[CONTAINS_KEYS].items():
            if isinstance(v, MutableMapping) and v.get(CONTAINS_KEYS):
                r[k] = reduce_schema(v)
            else:
                r[k] = None
    return r