import json

def get_ld_breadcrambs(items_list):

    elements_list = []
    i = 1
    while i <= len(items_list):
        item = items_list[i-1]
        url = None
        if type(item) == str:
            name = item
        elif type(item) == dict:
            name = item['name']
            url = item['url']
        else:
            name = item.name
            url = item.url

        Dict = {
            "@type": "ListItem",
            "position": i,
            "name": name,
        }
        if i < len(items_list):
            Dict.update({
                "item": url
            })

        elements_list.append(Dict)

        i += 1

    data = {
        "@context": "https://schema.org",
        "@type": "BreadcrumbList",
        "itemListElement": elements_list
    }

    return json.dumps(data)