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

Relative path is not resolved correctly #199

Closed
fenuks opened this issue Sep 30, 2020 · 4 comments · Fixed by #201
Closed

Relative path is not resolved correctly #199

fenuks opened this issue Sep 30, 2020 · 4 comments · Fixed by #201
Labels

Comments

@fenuks
Copy link

fenuks commented Sep 30, 2020

With version 0.30.0, compared to 0.29.4, openapi-validator regressed in way how relative paths are resolved.

I have following folder structure:

src/
    api1.yml
    api2.yml
    shared/
        common.yml

api1.yml and api2.yml files reference some definitions from shared/common.yml, e.g. responses shared/common.yml#/components/responses/NoContent.

If I run validator from other folder than src/ then e.g. lint-openapi src/api1.yml, then error is reported.

errors
  Message :   ENOENT: no such file or directory, open 'shared/common.yml'
  Path    :   paths./mymethod.post.responses.201.$ref
  Line    :   42

It seems as if relative path is now resolved in respect to current working directory, instead of relatively to specification file being processed.

Earlier versions work fine.

@dpopp07
Copy link
Member

dpopp07 commented Sep 30, 2020

@fenuks I'm surprised to see this, thank you for reporting the bug.

@jorge-ibm this may have to do with the Spectral integration - do you mind taking a look at it?

@fenuks
Copy link
Author

fenuks commented Sep 30, 2020

No problem. I'm using this program extensively, thank you for all hard work!

And I forgot to mention that running linter from the same directory where processed file is, naturally works as expected.

@jorge-ibm
Copy link
Contributor

This issue should be fixed as part of this PR #201

@dpopp07
Copy link
Member

dpopp07 commented Oct 2, 2020

🎉 This issue has been resolved in version 0.30.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants