Skip to content

definition parse errors on windows machines #640

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

Closed
jej2003 opened this issue Sep 26, 2023 · 2 comments
Closed

definition parse errors on windows machines #640

jej2003 opened this issue Sep 26, 2023 · 2 comments

Comments

@jej2003
Copy link
Contributor

jej2003 commented Sep 26, 2023

On windows machines the underlying json-schema-ref-parser fails to correctly resolve resources but has been addressed in APIDevTools/json-schema-ref-parser#315. Updating the json-schema-ref-parser to version 11.1.0 corrects this issue. #639 resolves this.

with a file named "api.json" 2 directories up the following code throws the below error on windows but works as expected on MacOS and Linux

   api = new OpenAPIBackend({
      definition: `file://${path.resolve(__dirname, '..', '..', 'api.json')}`, quick: true, handlers: {}
   })
   api.init()
ENOENT: no such file or directory, open 'C:\dev\project\project-maa-s\lambda\dataset\node_modules\@apidevtools\json-schema-ref-parser\dist\C:\dev\project\project-maa-s\lambda\dataset\api.json'
    at Object.<anonymous> (C:\dev\project\project-maa-s\lambda\dataset\node_modules\@apidevtools\json-schema-ref-parser\dist\lib\resolvers\file.js:72:23)
    at Generator.throw (<anonymous>)
    at rejected (C:\dev\project\project-maa-s\lambda\dataset\node_modules\@apidevtools\json-schema-ref-parser\dist\lib\resolvers\file.js:29:65) {
  code: 'ERESOLVER',
  name: 'ResolverError',
  source: 'C:\\dev\\project\\project-maa-s\\lambda\\dataset\\node_modules\\@apidevtools\\json-schema-ref-parser\\dist\\C:\\dev\\project\\project-maa-s\\lambda\\dataset\\api.json',    
  path: null,
  toJSON: [Function: toJSON],
  ioErrorCode: 'ENOENT',
  [Symbol(nodejs.util.inspect.custom)]: [Function: inspect]
}
@jej2003
Copy link
Contributor Author

jej2003 commented Oct 3, 2023

Good morning! I'm trying to understand the process to have this looked at. I believe it's fairly straight forward but any help in moving this along would be appreciated.

@anttiviljami
Copy link
Member

Hi @jej2003! Thanks for the PR. The latest version of @apidevtools/json-schema-ref-parser is now shipped as a dependency of [email protected]

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

Successfully merging a pull request may close this issue.

2 participants