recover by
add reference that does not exist in the swagger
const basePaths = dereferenced.servers && dereferenced.servers.length
? dereferenced.servers.map(({ url }) => new URL(url).pathname)
: [dereferenced.basePath || '/'];
Object.keys(dereferenced.paths).forEach(currentPath => {
dereferenced variable content will have the error details, so dereferenced.paths will be undefined.