Closed jared-christensen closed 3 years ago
This seems to work just fine for me:
import {WithContext, JobPosting} from "schema-dts";
const posting: WithContext<JobPosting> = {
"@type": "JobPosting",
"@context": "https://schema.org",
"hiringOrganization": {
"@type": "Corporation",
"name": "foo",
}
};
https://stackblitz.com/edit/typescript-rlhvuf
The TypeScript error is uninformative, but it could be because you don't have "@type"
on the hiringOrganization
object you just created.
I'm not sure what I had wrong but it's working now. Thanks for creating these, it's very nice to have types for these!
Great to know! And you're welcome :)
hiringOrganization seems to be missing name and other properties.
https://developers.google.com/search/docs/advanced/structured-data/job-posting#hiring
Property 'name' does not exist on type 'SchemaValue<Organization | IdReference>'. Property 'name' does not exist on type 'string'.ts(2339)