Skip to content

v0.15.0

Compare
Choose a tag to compare
@chharvey chharvey released this 27 Feb 16:51
· 52 commits to master since this release

Breaking

  • sdo_jsd.getMetaSchemata() has been replaced with sdo_jsd.META_SCHEMATA, an already-resolved Promise
  • sdo_jsd.getSchemata() has been replaced with sdo_jsd.SCHEMATA, an already-resolved Promise
  • sdoValidate first param type is narrowed to JSONLDObject (previously JSONLDDocument) — you can still send in a JSON-LD document, but it will silently pass without throwing an error, even if invalid
  • if using ajv to validate your own schema, must call .addSchema(await sdo_jsd.JSONLD_SCHEMA) before calling .addSchema(await sdo_jsd.SCHEMATA) since that is now excluded from the codebase (see README for details)
  • remove file /schema/json-ld.jsd and link to https://cdn.jsdelivr.net/gh/json-ld/[email protected]/schemas/jsonld-schema.json instead (exported as sdo_jsd.JSONLD_SCHEMA)

Features

  • export Schema.org vocabulary interfaces along with index file:
    // import * as sdo from 'schemaorg-jsd/dist/schemaorg.d' // old way
    import * as sdo from 'schemaorg-jsd' // new way
  • migrate some core functionality to @chharvey/requirejson, including requireJSON and some TypeScript interfaces
  • add TypeScript interfaces for some JSON types (JSON meta-schema and JSON-LD for rdfs:Classes and rdf:Propertys)

Fixes

  • the .details property of the error thrown by sdoValidate() now contains all the validation errors, instead of just the first one
  • update docs
  • simplify gulp build tasks
  • TypeScript v3.3
  • Gulp v4