json-schema-ref-parser
json-schema-ref-parser copied to clipboard
Dereferencing fails on Windows with CWD C:
To reproduce, create test.js somewhere:
var parser = require( 'json-schema-ref-parser' );
var path = require( 'path' );
parser.dereference( path.join( __dirname, 'test.yaml' ) );
Running test.js from cmd in working directory C:\ fails, running in C:\Users behaves correctly:
C:\>node C:\Users\me\workspace\json-schema-ref-parser-bug-cwd-c\test.js
(node:8048) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 5): SyntaxError: Unable to resolve $ref pointer "c:///Users/me/
workspace/json-schema-ref-parser-bug-cwd-c/test.yaml"
C:\>cd Users
C:\Users>node C:\Users\me\workspace\json-schema-ref-parser-bug-cwd-c\tes
t.js
(node:9092) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 4): SyntaxError: "c:/Users/me/workspace/json-schema-ref-parser-
bug-cwd-c/test.yaml" is not a valid JSON Schema
Oh wow, thanks! Good catch! I'll get this fixed