Skip to content

Commit

Permalink
feat: ability for a user to specify their own getNames function (#424)
Browse files Browse the repository at this point in the history
getNames is used to setup alias's for the client.  This would allow someone to specify their own aliases.  This relates to #418
  • Loading branch information
lholmquist authored and silasbw committed Mar 4, 2019
1 parent 707d845 commit 27ec13f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
Client: require('./swagger-client').Client,
Client1_10: require('./swagger-client').Client1_10,
alias: require('./alias'),
config: require('./config')
}
2 changes: 1 addition & 1 deletion lib/swagger-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class Client {
spec = JSON.parse(zlib.gunzipSync(fs.readFileSync(swaggerPath)))
}

const root = new Root({ splits: [], backend, getNames: getAliases })
const root = new Root({ splits: [], backend, getNames: options.getNames || getAliases })
if (spec) root._addSpec(spec)
return root
}
Expand Down

0 comments on commit 27ec13f

Please sign in to comment.