Open nickevansuk opened 4 years ago
Have come across this error while trying use validator in the imin pipeline, would be great to fix!
fields-not-in-model-rule.js
should also be updated to accept beta, schema.org and any extension types specified in the @context
The following error:
Is returned by the following data:
This error is incorrect, as there is no check being made against schema.org:
https://github.com/openactive/data-model-validator/blob/e63a1f6890425c287a1de09e1e75707e24e8df82/src/rules/core/valid-model-type-rule.js#L86-L100
valid-model-type-rule.js
should be improved to actually check against schema.org and beta types, possibly usingGraphHelper
(for beta and other extensions) andDataModelHelper.getSchemaOrgVocab()
(for schema.org) as infields-not-in-model-rule.js
.An alternative approach would be to refactor the extensions and schema.org referenced contexts into models on the fly, using something similar to this or this, however this is a larger refactor.