bcherny/json-schema-to-typescript

`compile()` ignores `$refOptions.resolve` settings

GabenGar opened this issue · 1 comments

Reproduction

https://github.com/GabenGar/repros

git clone https://github.com/GabenGar/repros ./repros
cd repros/nodejs/json-schema-to-typescript-file-path
npm install
npm run run

The Problem

Despite passing $refOptions.resolve.file.read() to not perform actual file system look up, it will still try to look up while resolving "$ref"s, and crash. Also there doesn't seem to be a way to intercept the raw value of "$ref" in the callback, since the value passed is already ran through path.resolve() and therefore the result is platform-specific.

This seems like a bug in json-schema-ref-parser. Feel free to file a bug/PR there: https://github.com/aPIDevTools/json-schema-ref-parser/.