speccy: Spaces in paths cause errors (breaking change in v0.8.0)

Detailed description

The speccy resolve command returns the following error, which I suspect are caused by the spaces in my (Windows) paths.

GET c:/My%20API/some-file.yaml
{ [Error: ENOENT: no such file or directory, open 'c:\My%20API\some-file.yaml']
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path:    'c:\\My%20API\\some-file.yaml' }

As you can see, it seems to be replacing the spaces with %20, which I suspect is the cause of the error.

This error only occurs with Speccy v0.8.0. It works fine with v0.7.3.

Your environment

Include as many relevant details about the environment you experienced the bug in and how to reproduce it.

  • Node Version: v10.8.0
  • Operating system and version: Windows 10

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Not sure if this is helpful or not, but I had to solve this same problem (illegal URL characters in filesystem paths) in json-schema-ref-parser. Here’s the relevant code for converting between filesystem paths and URLs…

https://github.com/BigstickCarpet/json-schema-ref-parser/blob/master/lib/util/url.js#L132-L217