json-schema-ref-parser
json-schema-ref-parser copied to clipboard
isExcludedPath is not a function.
Describe the bug
Version: 9.1.2
There is no fallback function for when excludedPathMatcher
is undefined.
To Reproduce
Call the deference function with no function argument for excludedPathMatcher
;
const dereference = require('@apidevtools/json-schema-ref-parser/lib/dereference');
dereference(handler, { parse: {}, dereference: {});
Actual behavior
An error is thrown saying that the isExcludedPath
is not a function.
Expected behavior No error is thrown
Fix
Update the following line https://github.com/APIDevTools/json-schema-ref-parser/blob/v9.1.2/lib/dereference.js#L44 to let isExcludedPath = options.dereference.excludedPathMatcher || (() => false);