-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BreadcrumbList itemListElement listitem with string item value #257
Comments
See this unit test for an example: |
No, I need |
Hey @throwaway20210 , unfortunately Schema.org has the property Using the example for JSON-LD on Schema.org for BreadcrumbList, the way you could implement what you want with objects would be similar to the following: {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@type": "Thing",
"name": "Books",
"url": "https://example.com/books"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@type": "Thing",
"name": "Science Fiction",
"url": "https://example.com/books/sciencefiction"
}
},{
"@type": "ListItem",
"position": 3,
"item": {
"@type": "Thing",
"name": "Award Winners",
"url": "https://example.com/books/sciencefiction/awardwinners"
}
}]
} You shouldn't have a problem achieving the above through Schema.NET. In theory, you could use the name and URL properties on Alternatively to using type "Thing" for the items, you could specify "WebPage" instead as they are all web pages. As an aside, breadcrumbs is actually a kinda weird schema representation. As a concept, they only exist with web pages so you would think a restriction to an item list that only has web pages would make sense. Yet because of using the shared |
I'd like to point out that isn't that case for Google, Google uses |
@AlizerUncaged What you see with Google taking a Url or a Thing is Google deviating from the schema.org standard which is where we generate our entire model from - if you want to complain to anyone, its either the people who wrote the standard or Google for not following it. The screenshot you got of their docs does say you can use a Thing with the |
Is it possible to produce JSON like this using this library ?
I tried but I get a compiler error when assigning a string to
item
The text was updated successfully, but these errors were encountered: