def METHOD_NAME(schema: Dict) -> str:
    """
    Return type of the given schema.
    It will also works for nested schema types.
    """
    if 'type' not in schema:
        return 'object'
    if type(schema['type']) is dict:
        return KafkaSchemaRegistryExtractor.METHOD_NAME(
            schema['type']
        )
    # If schema can have multiple types
    if type(schema['type']) is list:
        return '|'.join(schema['type'])
    if schema['type'] == 'record':
        properties = [
            f"{field['name']}:"
            f"{KafkaSchemaRegistryExtractor.METHOD_NAME(field)}"
            for field in schema.get('fields', {})
        ]
        if len(properties) > 0:
            if 'name' in schema:
                return schema['name'] + \
                    ':struct<' + ','.join(properties) + '>'
            return 'struct<' + ','.join(properties) + '>'
        return 'struct<object>'
    elif schema['type'] == 'array':
        items = KafkaSchemaRegistryExtractor.METHOD_NAME(
            schema.get("items", {})
        )
        return 'array<' + items + '>'
    else:
        return schema['type']