我正在尝试为ecom网站上的产品列表创建一些JSON-LD结构化数据,但是在使用Google的结构化数据测试工具时出现错误.
到目前为止,我有这个:
{
"@context": "http://schema.org",
"@type": "OfferCatalog",
"name": "Fresh Fruit",
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"item":
{
"@type": "Offer",
"price": "1.20",
"priceCurrency": "GBP",
"availability": "http://schema.org/InStock",
"url": "http://example.com/green-apples/",
"itemOffered": {
"@type": "Product",
"name": "Green Apples",
"url": "http://example.com/green-apples/"
}
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
大多数情况下它会验证,但Google工具会抛出以下错误:
为url提供的所有值必须指向同一页面.
错误突出显示第11行("@type": "Offer",).
URL字段似乎与(这已被证明是一个红鲱鱼,在下面的评论中)@context声明冲突,因为如果我将上下文更改为非url字符串或者http://example.com,它会验证(尽管这显然会导致其自身的问题).
我在这里错过了什么?感觉就像是一件非常明显的事情.