google 结构化数据测试工具错误

google Structured Data Testing Tool error

<script type="application/ld+json">
{"@context" : "http://schema.org",
  "@type" : "LocalBusiness",
  "name" : "website.com",
  "description": "About. asdadsad ",
  "image" : "http://website.com/image.png",
  "telephone" : "123456789",
  "email" : "mail@com",
  "address" : {
      "@type" : "PostalAddress",
      "streetAddress" : "N1 Big street",
      "addressLocality" : "city",
      "addressCountry" : "Country"
},
  "url" : "http://somesite.com/",
   "sameAs" : ["http://www.facebook.com/",
   "http://twitter.com",
   "http://plus.google.com/"],
   "aggregateRating" : {
       "@type" : "AggregateRating",
       "ratingValue" : "4",
       "bestRating" : "5",
       "worstRating" : "0"
},
</script>

这是我为 Web 架构创建的代码,但是当我尝试在 Google Structured Data Testing Tool 上进行测试时 returns 出现错误:

JSON-LD: There was an error parsing your JSON-LD.

我该如何解决这个问题?我在这段代码中有什么错误?

您的 JSON 末尾缺少右括号 }

您的最后一个 } 正在关闭 aggregateRating 权限,您有 none 关闭您的对象。

只需添加一个 } 即可。

PS:您的 AggregateRating 对象缺少 ratingCountreviewCount.

这是您的代码的固定版本:

<script type="application/ld+json">
{
  "@context" : "http://schema.org",
  "@type" : "LocalBusiness",
  "name" : "website.com",
  "description": "About. asdadsad ",
  "image" : "http://website.com/image.png",
  "telephone" : "123456789",
  "email" : "mail@com",
  "address" : {
    "@type" : "PostalAddress",
    "streetAddress" : "N1 Big street",
    "addressLocality" : "city",
    "addressCountry" : "Country"
  },
  "url" : "http://somesite.com/",
  "sameAs" : [
    "http://www.facebook.com/",
    "http://twitter.com",
    "http://plus.google.com/"
  ],
  "aggregateRating" : {
    "@type" : "AggregateRating",
    "ratingValue" : 4,
    "bestRating" : 5,
    "worstRating" : 0,
    "ratingCount" : 12
  }
}
</script>