from typing import Dict


def reorder_components(content: Dict) -> Dict:
    """Sort components properties in required order.

    Arguments
    ---------
    content
        OpenAPI content to be cleaned up.

    Returns
    -------
    Sorted OpenAPI content's components.

    """
    key_section = 'components'
    if key_section in content and isinstance(content[key_section], dict):
        target = {}
        for comp_prop in sorted(content[key_section].keys()):
            target.setdefault(comp_prop, {})
            # Sort components' subproperties
            for key in sorted(content[key_section][comp_prop].keys()):
                target[comp_prop].setdefault(
                    key, content[key_section][comp_prop][key])
        content[key_section] = target
    return content