JSON-LD missing ‘}’ – Google Structured Data Testing Tool

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

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://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!

(Visited 383 times, 1 visits today)

If you found this post useful ...

Buy Me a Coffee logo
Wondering why you keep seeing lower-cased 'i' in my posts? Read -> Why ‘i’ is not capitalized
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x