Fixing the JSON-LD missing ‘}’ error while using Google Structured Data Testing Tool

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

So, you’re implementing structured data on your site, particularly using JSON-LD (the latest Google recommendation regarding structured data), but when testing the file or the code used via the Structured Data Testing Tool, you receive an error–particularly this:

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

Fortunately, it has a pesky but quick fix. All you have to do is look for the superfluous trailing comma(s) throughout your code.

For instance, in the image below, you’ll notice in lines 15 and 19 they end with ‘,’ but should be removed.

JSON-LD Missing '}' screenshot -- Google Structured Data Testing Tool

And, boom, here’s the result of testing once i removed the commas on lines 15 and 19. Hopefully that helps you and your structured data implementation.

Fix for JSON-LD missing '}'

{
"@context": "https://schema.org",
"@type": "Restaurant",
"description":"Some example code for an Organization using JSON-LD.",
"name": "My Custom Restaurant",
"image": "https://www.macariojames.com/blog/wp-content/themes/hexo/assets/home/images/macariojames_tech_design_web_dev_consulting_logo2.jpg",
"url": "https://yoururl.com/", 
"logo": "https://yoururl.com/yourlogo.png", 
"address": {
 "@type": "PostalAddress",
 "addressLocality": "New Orleans",
 "addressRegion": "LA",
 "postalCode": "97202",
 "streetAddress": "Address Goes Here ",
 "addressCountry": "US"
},
"priceRange": "$$",
"servesCuisine": "Hot Wings",
"telephone": "504 123 4567"
}

Cheers. Happy coding!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.