google / react-schemaorg

Type-checked Schema.org JSON-LD for React
Apache License 2.0
487 stars 19 forks source link

Breaking potentialAction in Website type #6

Closed bsides closed 4 years ago

bsides commented 5 years ago

The schema:

{
    "@context": "http://schema.org",
    "@type": "WebSite",
    "url": "http://example.com/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": "http://example.com/search?&q={query}",
      "query": "required"
    }
}

As specified in https://schema.org/SearchAction doesn't compile. It throws at potentialAction, lots of errors in SearchAction, target, etc. Could you point me to the right direction to fix it? I'd gladly help.

Thanks!

EDIT: Fixed removing target, so I believe the error is from schema-dts. Issue opened there https://github.com/google/schema-dts/issues/45

Eyas commented 4 years ago

The workaround is:

      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "http://example.com/search?&q={query}"
      },

instead of just string. will fix in schema-dts.