APIDevTools / json-schema-ref-parser

Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
https://apitools.dev/json-schema-ref-parser
MIT License
942 stars 226 forks source link

isExcludedPath is not a function. #312

Closed ParsonsProjects closed 5 months ago

ParsonsProjects commented 1 year ago

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

jonluca commented 5 months ago

Fixed in v10