-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Wrong path on Windows #2052
Comments
Thanks. Seems quite a few people run into this issue |
All I had to do to fix it was to use the newest json-schema-ref-parser by overriding its depedency in package.json "pnpm": {
"overrides": {
"@apidevtools/json-schema-ref-parser": "11.1.0"
}
} |
@tajnymag hm, this package used that version before and people still complained so it got reverted |
Interesting. I'll try to find out why it worked and why it would't. I tried it with openapi-codegen (your version) installed as a devDependency |
@tajnymag thanks, let me know if you find out please. I didn't get around to trying this one out yet |
So far, I can only say original and fork behave the same in regard to this issue and workaround. |
@tajnymag i suspect we'll need to fork the other package too APIDevTools/json-schema-ref-parser#303 |
@mrlubos I think I fixed the issue. Basically followed @mmospanenko's suggestion and made all passed paths to json-schema-ref-parser absolute. Both of these had to be made together to pass our tests
|
@tajnymag is the absolute path conversion happening inside this package or is that something you do before passing the value to edit: I see! Do you want to open a pull request against our fork? |
@mmospanenko we've published a fix in our fork, mind giving it a try and see if it works without the need for workarounds on your end? |
I can't test on Windows, it was funny testing game while we were trying to solve the issue)) but yes, will be great to remove workaround, thank you, @mrlubos! |
@mmospanenko i don't have the permissions to close issues in this repository, but as long as our fix works for you, I will continue referring people to our fork if they experience the same issue |
@mrlubos Your fork hasn't fixed this issue for me on windows. Any version after json-schema-ref-parser@9.0.9 is causing this problem |
Can you share with us a small repo reproducing the problem? The commited fix did fix the tests on my machine. Perhaps there's a case I overlooked and did not test. |
@tajnymag That was my mistake. I hadn't updated the package to the latest version with your changes. Seems to working now. Thanks for contributing |
Cool stuff @tajnymag, thanks for confirming @o0Maikeru0o |
On Windows, when use app under another process, RefParser gets wrong path. And as result - it joins abs and rel paths from package and argument. So I had to fix it like this:
STR:
The text was updated successfully, but these errors were encountered: