'JSON-LD Missing '}' or object member name. error
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
Solution 1:[1]
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>
Solution 2:[2]
I ran into the exact same issue. The JSON-LD markup has nothing to do with trailing commas after the last element, etc. Yours is absolutely correct.
However, please note that single quotes or '' are not accepted by Google. You must use double quotes or "" for each and every key and value, including the elements in an array and not the array itself.
Solution 3:[3]
I faced the same issue and found a unusual reason for the error. In my case an unknown blank character was causing the issue.
I simply replaced all those unknown blank characters with spaces and it worked for me.
Se attached images.
Solution 4:[4]
If your schema have this
"
then try to replace it with normal
"
Solution 5:[5]
Same problem happened to me. In my case, it works just deleting the last coma after "" and putting and the end after }.
"contactType": "customer service" <==
(YOU DONT HAVE COMMA HERE, BUT IF THIS IS THE CASE YOU SHOULD DELETE THE COMA)
}], <==(AND PUT IT HERE)
}, <==(OR HERE, YOU JUST TRY IT)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | P-S |
| Solution 2 | Pranav Ambwani |
| Solution 3 | |
| Solution 4 | Kyo Huu |
| Solution 5 | ouflak |


