openmhealth / schemas

A repository of Open mHealth schemas.
Apache License 2.0
71 stars 45 forks source link

Add support for validating top-level remote schemas #17

Closed emersonf closed 1 year ago

emersonf commented 1 year ago

Problem

It would be helpful to write test data for remote schemas, e.g. those under the IEEE namespace, without having local copies of those schemas.

Solution

If the validator doesn't find a local schema file corresponding to a test data file's schema ID, it attempts to fetch a remote schema using a base URI derived from the schema ID. If it finds a remote schema, the test data file is validated against the retrieved schema. If it doesn't find a remote schema, a warning is shown.