Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON-LD Missing '}' or object member name. error

Tags:

json

json-ld

I like to add json-ld to my website before that I want to add it to my dev site to test it

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "url": "xxxxxxxxxxxxxxxx",
  "contactPoint": [{
    "@type": "ContactPoint",
    "telephone": "+xx-xxx-xxx-xxxx",
    "contactType": "customer service"

  }]
}
</script>

I get the error stating that Missing '}' or object member name. what is this error,I have closed brackets correctly.how to fix it kindly help

like image 322
sudan kanakavel Avatar asked Jun 27 '16 12:06

sudan kanakavel


1 Answers

Usually this error is because of unneeded commas, make sure to remove the trailing comma from all last elements in every { } block.

Example snippet:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "Article",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "http://foo.bar", // Remove comma here
    }, // Remove comma here

    // Add other required fields if necessary
}
</script>
like image 155
P-S Avatar answered Sep 24 '22 07:09

P-S