jrgen
jrgen copied to clipboard
fix: chdir to dir of spec file to fix parsing error of refs
- Found error:
$ pwd
/home/foo/jsonrpc
$ jrgen docs-html sub/index.json
/home/foo/jsonrpc/node_modules/jrgen/src/utils.js:201
throw error;
^
ResolverError: Error opening file "/home/foo/jsonrpc/methods/session/login.json"
ENOENT: no such file or directory, open '/home/foo/jsonrpc/methods/session/login.json'
at ReadFileContext.callback (/home/foo/jsonrpc/node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/file.js:52:20)
at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:282:13) {
code: 'ERESOLVER',
source: '/home/foo/jsonrpc/methods/session/login.json',
path: null,
toJSON: [Function: toJSON],
ioErrorCode: 'ENOENT',
[Symbol(nodejs.util.inspect.custom)]: [Function: inspect]
}
error Command failed with exit code 1.
- Project files:
jsonrpc
|- sub
| |- methods
| | |- session
| | |- login.json
| |- index.json
|- node_modules
|- package.json
index.json uses "./methods/session/login.json" to refer login.json
I think because of 17334593fc54c5db462b679dd4b46a649c677dbe it should work correctly now. Could you please test if the problem is still present after the next release?