Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
temporary solution for circular references in JSON without upgrading …
Browse files Browse the repository at this point in the history
…past 7.6
  • Loading branch information
tsamsonbm committed Oct 11, 2018
1 parent fe852dd commit 5c19c7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,10 @@ internals.overload = function (base, priority) {
*/
internals.hasFileType = function (route) {

let routeString = JSON.stringify(route);
const routeString = JSON.stringify(route, (key, value) => {
// _currentJoi is a circular reference, introduced in Joi v11.0.0
return key === '_currentJoi' ? undefined : value;
});
return routeString.indexOf('swaggerType') > -1;
};

Expand Down

0 comments on commit 5c19c7d

Please sign in to comment.