Skip to content

Commit

Permalink
Merge pull request #79 from ucd-library/dc-swagger-global-fix
Browse files Browse the repository at this point in the history
update swagger base to not require paths when defined
  • Loading branch information
qjhart authored Feb 28, 2024
2 parents c495468 + a969c88 commit 8e73bfa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions services/fin/node-utils/lib/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ class FinModelLoader {

// merge swagger with swaggerBase
if( !Array.isArray(swagger.paths) ) {
swagger.paths = Object.entries(swagger.paths).map(([key, value]) => ({ path : key, docs : value }));
swagger.paths = Object.entries((swagger.paths || {})).map(([key, value]) => ({ path : key, docs : value }));
}
if( !Array.isArray(swaggerBase.paths) ) {
swaggerBase.paths = Object.entries(swaggerBase.paths).map(([key, value]) => ({ path : key, docs : value }));
swaggerBase.paths = Object.entries((swaggerBase.paths || {})).map(([key, value]) => ({ path : key, docs : value }));
}

swagger.paths.forEach(path => {
Expand Down

0 comments on commit 8e73bfa

Please sign in to comment.