opticdev/optic

Cannot view diff report

davidkeaveny opened this issue · 2 comments

When I run the optic diff against my OpenAPI specification, the operation completes successfully and gives me a brief summary; if I then run it again with the --web setting so I get the full report, I receive an ENAMETOOLONG error. I'm assuming that the error here is occurring when it tries to open a browser to display the report?

I am running the following against Optic 0.46.0 on Windows 11 (22H2) and Node 18.16.0:

optic diff open-api.yaml --base main --web

which ends with the following:

GET /employees/{employeeId}/roster-shifts:
  - query parameter PageSize: removed
  - query parameter PageNumber: removed
  - query parameter pageNumber: added

  - query parameter pageSize: added

  - response 200:
    - body application/octet-stream: removed
      - property : removed
    - body application/json: added
      - property : added

...and 94 other endpoints

See the full history of this API by running "optic api add open-api.yaml --history-depth 0"
Opening up diff in web view
Error: spawn ENAMETOOLONG
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:757:9)
    at baseOpen (C:\Users\david.keaveny\AppData\Roaming\npm\node_modules\@useoptic\optic\node_modules\open\index.js:224:34) {
  errno: -4064,
  code: 'ENAMETOOLONG',
  syscall: 'spawn'
}
spawn ENAMETOOLONG

Is the web report written somewhere in the temporary file system, so that I could have a look at it? Or is there any chance of having an explicit write-to-file option in the diff?

niclim commented

Hi @davidkeaveny - I just released a new version 0.47.4 that tries works around this issue on windows - could you try it out and let me know if that works for you?

Hi @niclim - many thanks for the update, I've upgraded to 0.47.5, and now when I run the same command as before, it doesn't give the error as above, but writes the diff report to the screen. That's a big improvement for me, so many thanks again!