Skip to content

schema-dts & schema-dts-gen v0.11.0

Compare
Choose a tag to compare
@Eyas Eyas released this 17 Aug 19:00
· 27 commits to main since this release

Changes in schema-dts & schema-dts-gen

  • Role, OrganizationRole and others are allowed to be use in place of all properties in Schema.org. See #143 & notes in #164
    • This also corrects the "Role" type to be generic. A Role type (and its sub classes) is contextual in the context of the property it is used in. E.g. Role in an alumniOf will have a nested alumniOf property, for example:

      import { Person, WithContext } from 'schema-dts';
      
      const p: WithContext<Person> = {
        '@context': 'https://schema.org',
        '@type': 'Person',
        name: 'Delia Derbyshire',
        sameAs: 'http://en.wikipedia.org/wiki/Delia_Derbyshire',
        alumniOf: {
          '@type': 'OrganizationRole',
          alumniOf: {
            '@type': 'CollegeOrUniversity',
            name: 'University of Cambridge',
            sameAs: 'http://en.wikipedia.org/wiki/University_of_Cambridge'
          },
          startDate: '1959'
        }
      };
    • See http://blog.schema.org/2014/06/introducing-role.html for more details

Diffs vs previous version of schema-dts: https://www.diffchecker.com/Q5wPQvi0