如何解决JSON-LD错误“发现重复密钥”?

时间:2018-04-24 09:22:55

标签: json schema.org json-ld

我的Schema.org将此代码用于办公时间,并且在使用https://search.google.com/structured-data/testing-tool

测试网址时出现错误

我如何删除此错误:

  

找到JSON-LD重复密钥。

我知道问题出在哪里:opensclosesdaysOfWeek,这些项目会重复出现。

我找到了this solution,但我的问题与此不同。

请告诉我可能的解决方案,以便我可以相应地更改数据。

JSON-LD包含代码:

"openingHoursSpecification": {
"@context" : "http://schema.org",
"@type" : "openingHoursSpecification",
"opens" : "11:20 am ",
"closes": " 7:30 pm",
"dayOfWeek": {
"@context" : "http://schema.org",
"@type" : "dayOfWeek",
"name": "Mon"
},
"opens" : "10:20 am ",
"closes": " 7:30 pm",
"dayOfWeek": {
"@context" : "http://schema.org",
"@type" : "dayOfWeek",
"name": "Tue-Wed"
},
"opens" : "9:00 am ",
"closes": " 10:00 pm",
"dayOfWeek": {
"@context" : "http://schema.org",
"@type" : "dayOfWeek",
"name": "Thu"
},
"opens" : "11:00 am ",
"closes": " 4:00 pm",
"dayOfWeek": {
"@context" : "http://schema.org",
"@type" : "dayOfWeek",
"name": "Fri"
},
"opens" : "6:00 am ",
"closes": " 6:00 pm",
"dayOfWeek": {
"@context" : "http://schema.org",
"@type" : "dayOfWeek",
"name": "Sat"
},
"opens" : "10:00 am ",
"closes": " 11:40 pm",
"dayOfWeek": {
"@context" : "http://schema.org",
"@type" : "dayOfWeek",
"name": "Sun"
}},

1 个答案:

答案 0 :(得分:2)

您找到的解决方案也适用于您的案例。如果属性有多个值,则需要use an array

UITextView