json-schema-ref-parser icon indicating copy to clipboard operation
json-schema-ref-parser copied to clipboard

isExcludedPath is not a function.

Open ParsonsProjects opened this issue 1 year ago • 0 comments

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);

ParsonsProjects avatar Mar 09 '23 14:03 ParsonsProjects