Schemaorg: SMV reports third party context as invalid instead of ignoring it.

Created on 12 Jul 2021  ·  2Comments  ·  Source: schemaorg/schemaorg

Validating a page with the Schema Markup Validator that includes schema.org and also other JSON-LD data results in error messages like There was an invalid type in your JSON-LD..

This can be reproduced by entering the following code into the validator:

<script type="application/ld+json">
{
  "@context": "https://json-ld.org/contexts/person.jsonld",
  "@type": "Person",
  "name": "Foo"
}
</script>

This results in an “Uncategorized Errors” box with the error “There was an invalid type in your JSON-LD.”

smv-screenshot

This can be very confusing because it is not an “invalid type” but instead a @context not supported by the validator.

It would be very helpful if this error could be changed to a notice, something like “Unsupported third party Contexts: The context https://json-ld.org/contexts/person.jsonld does not get validated by this validator.”

Is the source code of the validator on GitHub? If so, I can try to make a pull request for this change.

Related question on Stack Overflow: https://stackoverflow.com/questions/68308709

Most helpful comment

Thanks - noted and acknowledged. The tool is not opensource (it is a view provided by Google's structured data validation infrastructure). I will make sure these issues are addressed or documented before we link the new validator more prominently from Schema.org.

All 2 comments

Thanks - noted and acknowledged. The tool is not opensource (it is a view provided by Google's structured data validation infrastructure). I will make sure these issues are addressed or documented before we link the new validator more prominently from Schema.org.

Thank you very much @danbri !

Can or should I keep this issue open until the validator got fixed?

Was this page helpful?
0 / 5 - 0 ratings