There were a couple of breaking changes introduced in v2.0.0 in json-refs as detailed here.
The options.processContent callback needs to be nested as options.loaderOptions.processContent as there is a new module (path-loader) that is doing the content loading and also, it has a new signature to enable asynchronous processing of content done by a callback that needs to be called (details are at https://github.com/whitlockjc/path-loader/issues/7).
Another new option that is added (filter : ['relative', 'remote']) enables retaining the local references (like the schema for 200 within responses below - which is retained as "$ref": "#/definitions/User"), since it is a local reference that is not supplied in the filter (details about the filter option is here).
Below is how the result now looks with the updated code and dependencies:
There were a couple of breaking changes introduced in v2.0.0 in
json-refs
as detailed here.The
options.processContent
callback needs to be nested asoptions.loaderOptions.processContent
as there is a new module (path-loader
) that is doing the content loading and also, it has a new signature to enable asynchronous processing of content done by a callback that needs to be called (details are at https://github.com/whitlockjc/path-loader/issues/7).Another new option that is added (
filter : ['relative', 'remote']
) enables retaining the local references (like theschema
for200
withinresponses
below - which is retained as"$ref": "#/definitions/User"
), since it is a local reference that is not supplied in the filter (details about thefilter
option is here).Below is how the result now looks with the updated code and dependencies: