Skip to content

Bug: Relative paths do not work with the `ref` expression

When using the ref expression in configurations, the reference is resolved relative to the current working directory and not the file doing the referencing.

You can reproduce by creating a directory, then adding a yaml in there with:

my_value: $ref{base/base.yml:my_value}

Then add a directory named base and a file in there named base.yml with:

my_value: 5

Finally run the following script in the same directory as the original folder added:

import asyncio
from manifest import Manifest

class MyModel(Manifest):
    my_value: int

async def main():
    await MyModel.from_files(["first_yaml_created.yml"])

if __name__ == "__main__":
    asyncio.run(main())