Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use import in yaml definitions with relative path #595

Open
aokros opened this issue Sep 14, 2023 · 0 comments
Open

Unable to use import in yaml definitions with relative path #595

aokros opened this issue Sep 14, 2023 · 0 comments

Comments

@aokros
Copy link

aokros commented Sep 14, 2023

Hi,
I'm having trouble using the import: "some.yaml" function in yaml files. I'm using a setup where the API descriptions are in separate files and I use Blueprints to define the API itself. I'd like to remove a lot of redundancy in parameters by using $ref and it would be great to use the import option in the yaml files so I can easily reference the parameters, allowed values across the API.
After a lot of debugging I ended up with there must be some issues around how root_path is used when reading the yaml files and attempting to parse and include the imported yamls.

I ended up changing this line to use the obj.root_path whenever exists and fallback to the get_root_path function if it does not. With this change now I can successfully import yamls files by using relative paths.

root_path = get_root_path(obj)

Do you think it makes sense to add this change to the code, or there is a well-known reason behind the current implementation? Alternatively I might miss some configuration that would solve this issue instantly...

Thanks a lot!

--Attila

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant