Skip to content

v3.0 - Improved schema validation logic

Compare
Choose a tag to compare
@iaincollins iaincollins released this 13 Aug 00:03
· 50 commits to master since this release

In this release, Schema.org validation and Google Structured Data validation have been split so markup can validated independently for technical correctness and for vendor compatibility.

There are easy to accommodate but breaking API changes in this release, which should provide a stable API foundation for future updates.

New in this release

  • Automatically detects Schema.org markup and tests it separately from vendor specific validation.
  • You can now use --schemas to specify schemas to check for as well as to list them.
  • You can optionally prefix schema names with 'jsonld:', 'microdata:', 'rdfa:' to check for a schema specified in a particular way (e.g. --schemas Article or --schemas jsonld:Article or --schemas Microdata:Article).
  • You can specify one or more schemas to check for, the same way the --presets option works (e.g. --schemas "jsonld:Article,BreadcrumbList,microdata:WPFooter")
  • Presets can now contain other presets (to any level), to allow for easier organisation of tests. e.g. use --presets SocialMedia to test social media markup, or --presets Google to apply rules based on those for the Google Structured Data Testing Tool.
  • Presets can now have conditional tests to determine if a preset is invoked, which is useful when grouping presets inside other presets, so that groups of tests are only applied when appropriate.
  • Individual tests within presets can now have conditional tests to determine if they should run.
  • Added new preset called 'Google' which checks commonly used schemas for structured data properties that Google expects to see.
  • Added a new preset called 'SocialMedia', containing both Twitter and Facebook presets.
  • Removed --disable-presets option as is now redundant.
  • All options available via both API and Command Line Tool.
  • Updated README and inline documentation.

Known limitations

  • This update does not validate if individual Schema.org schema properties exist or check if the contents of those properties are valid (this is possible with the API using a custom preset).
  • The Google preset is contains subset of tests based on responses from the Google Structured Data Testing Tool and tests for all known Article schema types, but does not validate all supported Schemas or test the contents of properties using the same rules (this is possible with the API using a custom preset).