Phillip Long
Phillip Long

Reputation: 13

JSON-LD JobPosting with multiple locations: "Missing '}' or object member name."

I'm trying to put together a JobPosting that has multiple locations listed. In the Structured Data Type Definitions listed on the developers.google.com site, it says:

If the job has multiple locations, add multiple jobLocation properties in an array. Google will choose the best location to display based on the job seeker's query.

But I continue to get an error:

  "jobLocation":[
{
    "@type":"Place",
    "address":{
        "@type":"PostalAddress",
        "streetAddress":"1366 N Mockingbird Ln.",
        "addressLocality":"Abilene",
        "addressRegion":"TX",
        "postalCode": "79603",
    }    
}
{
    "@type":"Place",
    "address":{
        "@type":"PostalAddress",
        "streetAddress":"3301 South 1st Street",
        "addressLocality":"Abilene",
        "addressRegion":"TX",
        "postalCode": "79603"
    }
}
]  

Missing '}' or object member name.

The item that is highlighted is the first closing bracket after the first postalCode.

Upvotes: 1

Views: 737

Answers (2)

Lucien
Lucien

Reputation: 1

I think you need a comma after the ] - here is how it worked for me:

        "jobLocation": [
        {
            "@type": "Place",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "XYZ",
                "addressLocality": "XYZ",
                "postalCode": "XYZ",
                "addressCountry": "DE"
            }
        },
        {
            "@type": "Place",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": " XYZ",
                "addressLocality": "XYZ",
                "postalCode": "XYZ",
                "addressCountry": "DE"
            }
        }

    ],

Upvotes: 0

unor
unor

Reputation: 96697

Remove the comma in "postalCode": "79603",, and add a comma to separate the items in the array:

"jobLocation": [
  {},
  {}
] 

Upvotes: 1

Related Questions