You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a swagger document with references which are valid JSON schema references (URIs), These are references to an internal library of schemas which understands this URI with a "schema://" protocol. Currently, I don't see any way of providing a function to resolve references myself. The preprocessor would be the only visible place to do this, although the output of the preprocessor has to be something which is still not dereferenced, otherwise you will end up getting the following error: (there should probably be a check on the return value of refPreProcessor to validate that the value is still ref-like.
{code}
TypeError: Cannot read property 'reference' of undefined
at getRefType (C:\git\s\node_modules\json-refs\index.js:156:33)
at refFilter (C:\git\s\node_modules\json-refs\index.js:258:77)
at C:\git\s\node_modules\json-refs\index.js:269:82
at C:\git\s\node_modules\json-refs\index.js:269:82
at Object.filter (C:\git\s\node_modules\json-refs\index.js:269:82)
at C:\git\s\node_modules\json-refs\index.js:606:24
at walk (C:\git\s\node_modules\json-refs\index.js:436:23)
at walkItem (C:\git\s\node_modules\json-refs\index.js:430:5)
at C:\git\s\node_modules\json-refs\index.js:450:11
at C:\git\s\node_modules\lodash\lodash.js:4911:15
{code}
I'd like to be able to provide an async function/promise/function with callback with similar parameters to refPreProcessor, so that I can resolve specific references myself and then fall back to json-refs if this was not possible (for example by returning/resolving with the original ref-like object).
The text was updated successfully, but these errors were encountered:
I will get started on whitlockjc/path-loader#1, update json-refs to use the new version of path-loader and then you could pass on options.jsonRefs.loaderOptions to use a custom loader.
I have a swagger document with references which are valid JSON schema references (URIs), These are references to an internal library of schemas which understands this URI with a "schema://" protocol. Currently, I don't see any way of providing a function to resolve references myself. The preprocessor would be the only visible place to do this, although the output of the preprocessor has to be something which is still not dereferenced, otherwise you will end up getting the following error: (there should probably be a check on the return value of refPreProcessor to validate that the value is still ref-like.
{code}
TypeError: Cannot read property 'reference' of undefined
at getRefType (C:\git\s\node_modules\json-refs\index.js:156:33)
at refFilter (C:\git\s\node_modules\json-refs\index.js:258:77)
at C:\git\s\node_modules\json-refs\index.js:269:82
at C:\git\s\node_modules\json-refs\index.js:269:82
at Object.filter (C:\git\s\node_modules\json-refs\index.js:269:82)
at C:\git\s\node_modules\json-refs\index.js:606:24
at walk (C:\git\s\node_modules\json-refs\index.js:436:23)
at walkItem (C:\git\s\node_modules\json-refs\index.js:430:5)
at C:\git\s\node_modules\json-refs\index.js:450:11
at C:\git\s\node_modules\lodash\lodash.js:4911:15
{code}
I'd like to be able to provide an async function/promise/function with callback with similar parameters to refPreProcessor, so that I can resolve specific references myself and then fall back to json-refs if this was not possible (for example by returning/resolving with the original ref-like object).
The text was updated successfully, but these errors were encountered: