1

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>
unor
  • 92,415
  • 26
  • 211
  • 360
Nielsvh
  • 1,151
  • 1
  • 18
  • 31

1 Answers1

1

Your JSON-LD seems to be correct and your use of Schema.org seems to be appropriate:

  1. GovernmentService can have the availableChannel property
  2. availableChannel expects a ServiceChannel value
  3. ServiceChannel can have the servicePhone property
  4. servicePhone expects a ContactPoint value

This 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.

Community
  • 1
  • 1
unor
  • 92,415
  • 26
  • 211
  • 360
  • I figured it was something to do with the tool, since there are others that have had a similar issue where the error should be a warning. I'm just wondering if there is a way to get it to validate so that Google doesn't skip/ignore something I deem important – Nielsvh Mar 25 '16 at 23:40