23andMe / Yamale

A schema and validator for YAML.
MIT License
670 stars 88 forks source link

Support relative schema path #192

Closed jtyr closed 5 months ago

jtyr commented 2 years ago

This PR is adding a check if the specified schema is actually a path to an existing file. Without this change, the schema cannot be find if the data path and the schema path combination doesn't produce an existing path to the schema. To demonstrate this, let's have this directory structure:

/dir1/data/myfile.yaml
/dir2/schemas/myfile.yaml

If we are in the /dir2 and we run Yamale, the schema is not found:

cd /dir2
yamale -s ./schemas/myfile.yaml /dir1/data/myfile.yaml
mildebrandt commented 2 years ago

Thanks! This may cause a breaking change to some use cases....I'll research a bit.

jtyr commented 2 years ago

As you look into this, please could you also look into the other PR #171 I have create a while ago?

cblakkan commented 5 months ago

This was fixed in another PR. Thanks for the contribution, sorry it took so long :)