schema-dts icon indicating copy to clipboard operation
schema-dts copied to clipboard

sameAs as an array

Open retroriff opened this issue 2 years ago • 2 comments

I see that sameAs is a string attribute and I was wondering if it also should be a string[] so it can accept a list of social networks, as explained here.

{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Company Name",
  "url": "company.com",
  "logo": "company.com/logo.png",
  "sameAs": [
    "https://facebook.com/",
    "https://twitter.com/",
  ]
}

retroriff avatar May 30 '22 12:05 retroriff

Yep, all attributes (other than "@context", "@type", and "@id") can be either their direct type or an array as-is. Let me know if you're having trouble using it as such!

Eyas avatar May 31 '22 14:05 Eyas

@Eyas I'm having a some trouble using string[] for sameAs

Type 'string[]' is not assignable to type 'string | Role<string, "sameAs">'.ts(2322)

Any insight? 🙏🏼

mirhamasala avatar Feb 09 '24 12:02 mirhamasala