OPENAPI_DIFF_READ_ERROR on Local Files
Command Run openapi-diff "C:\Temp\swagger.json" "C:\Temp\web-swagger.json" results in an error
ERROR: unable to open "C:\Temp\swagger.json": Invalid URI "c:/Temp/swagger.json" at ContentLoader.<anonymous> (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\content-loader.js:45:23) at Generator.throw (<anonymous>) at rejected (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\content-loader.js:6:65) { jse_shortmsg: 'Unable to load "C:\Temp\swagger.json"', jse_cause: VError: ERROR: unable to open "C:\Temp\swagger.json": Invalid URI "c:/Temp/swagger.json" at Request._callback (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\resource-loader\http-client.js:11:28) at self.callback (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\request.js:185:22) at Request.emit (node:events:376:20) at Request.init (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\request.js:273:17) at new Request (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\request.js:127:8) at request (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\index.js:53:10) at Function.get (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\index.js:61:12) at C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\resource-loader\http-client.js:9:21 at new Promise (<anonymous>) at HttpClient.get (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\resource-loader\http-client.js:8:16) { jse_shortmsg: 'ERROR: unable to open "C:\Temp\swagger.json"', jse_cause: Error: Invalid URI "c:/Temp/swagger.json" at Request.init (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\request.js:273:31) at new Request (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\request.js:127:8) at request (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\index.js:53:10) at Function.get (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\node_modules\request\index.js:61:12) at C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\resource-loader\http-client.js:9:21 at new Promise (<anonymous>) at HttpClient.get (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\resource-loader\http-client.js:8:16) at ContentLoader.<anonymous> (C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\content-loader.js:42:46) at Generator.next (<anonymous>) at C:\Program Files (x86)\Jenkins\tools\jenkins.plugins.nodejs.tools.NodeJSInstallation\NodeJS_15.4_OpeApi-diff\node_modules\openapi-diff\dist\openapi-diff\content-loader.js:8:71, jse_info: {} }, jse_info: {}, code: 'OPENAPI_DIFF_READ_ERROR' }
Comments (3)
-
Account Deactivated -
Agreed, this does look like some kind of windows specific issue, the slashes look like they’ve been flipped in the error message. I suspect the fix it probably simple, like passing the input path through some kind of parsing function before hading it to
fs
.However, we have no way to run our automated tests on a Windows environment, which I consider to be a blocker to us adding offical Windows support.
Running the tool in a Mac OS or Linux based environment is highly recommended. Another workaround may be to use this modules nodejs API instead of the cli interface. This may work because the nodejs API has no file handling logic, you need to load the files prior to calling it.
-
- changed status to wontfix
- Log in to comment
CC@{5a80de79088c7731042d5e68}
I guess we don’t support windows (probably path forward-backward slash related). Even if we wanted to support it, we can’t test it in Bitbucket pipelines. We may need to update the Readme to clarify that.
Alternatively, windows users could run the tool within a docker container.