So I have the following JSON-LD markup that passes the markup tester (https://www.google.com/webmasters/markup-tester/) with no errors but fails the Structured data testing tool (https://developers.google.com/structured-data/testing-tool/) with "ContactPoint must be attached to a parent with a declared type."
As far as I can tell, my ContactPoint is attached to my GovernmentService object. Is there something off that I'm not seeing?
<script type='application/ld+json'>
{
"@context": "http://schema.org",
"@type": "GovernmentService",
"name": "Jibber Jabber",
"serviceType": "Jabber Application",
"description": "The Jibber Jabber application is tired of you Jibber jabber!",
"availableChannel": {
"@type": "ServiceChannel",
"serviceUrl": "http://rustled.jimmies.com/",
Error-->"servicePhone": {
"@type" : "ContactPoint",
"telephone" : "+1505890897",
"name" : "Jabber phone service",
"contactType": "customer support"
}
},
"url": "http://jibjab.rustled.jimmies.com",
"provider": {
"@type": "GovernmentOrganization",
"name": "Jibbering and Howling",
"url": "http://desertbluffs.state.az.gov",
"logo": "http://desertbluffs.state.az.gov/Eagle.gif"
}
}
</script>
Your JSON-LD seems to be correct and your use of Schema.org seems to be appropriate:
GovernmentService
can have the availableChannel
propertyavailableChannel
expects a ServiceChannel
valueServiceChannel
can have the servicePhone
propertyservicePhone
expects a ContactPoint
valueThis minimal JSON-LD gives the same error in Google’s SDTT:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "GovernmentService",
"availableChannel": {
"@type": "ServiceChannel",
"servicePhone": {
"@type" : "ContactPoint"
}
}
}
</script>
The error message refers to Google’s Knowledge Graph feature Corporate Contacts. Unless I’m missing something, this seems to be one of the many cases where an error in Google’s tool does not mean that your markup is wrong.