I am trying to create some JSON-LD structured data for a list of products on an ecom-site but I am getting an error when using Google's Structured Data Testing Tool.
So far, I have this:
{
"@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/"
}
}
}
]
}
Mostly it validates, but the Google tool throws the following error:
All values provided for url must point to the same page.
The error highlights line 11 ("@type": "Offer",
).
The URL fields seem to be clashing with the (This has been shown to be a red-herring, in the comments below)@context
declaration, because if I change the context to either a non-url string or http://example.com
, it validates (although, this obviously causes its own issues).
What am I missing here? It feels like something blindingly obvious.
@context
is not surprising: You are using a different vocabulary then (not Schema.org anymore). Google’s SDTT is only meant for Schema.org. – Stickup@context
declaration […]") -- I just wanted to point out that the problem is not related to the context, or in other words: if you change the context, the SDTT stops reporting any vocabulary use errors (because it’s no longer Schema.org as soon as you change the context). – StickupListItem
to see if there were issues with different URLs in each. But even copying and pasting the same URL line in each location generates the error. I waver between thinking I'm missing something and thinking that it's a bug in the validator. I even tried nesting theOffer
within theProduct
intead of the other way around, but it made no odds. – Frightened