forked from loafle/openapi-generator-original
fix: 🐛 Added ability to override basePath while creating ApiClient instance (#10327)
Solves #9179
This commit is contained in:
parent
31342580cb
commit
538f12c36d
@ -16,13 +16,18 @@ import querystring from "querystring";
|
||||
* @class
|
||||
*/{{/emitJSDoc}}
|
||||
class ApiClient {
|
||||
constructor() {
|
||||
/**
|
||||
* The base URL against which to resolve every API call's (relative) path.
|
||||
* Overrides the default value set in spec file if present
|
||||
* @param {String} basePath
|
||||
*/
|
||||
constructor(basePath = '{{{basePath}}}') {
|
||||
{{#emitJSDoc}}/**
|
||||
* The base URL against which to resolve every API call's (relative) path.
|
||||
* @type {String}
|
||||
* @default {{{basePath}}}
|
||||
*/{{/emitJSDoc}}
|
||||
this.basePath = '{{{basePath}}}'.replace(/\/+$/, '');
|
||||
this.basePath = basePath.replace(/\/+$/, '');
|
||||
|
||||
{{#emitJSDoc}}/**
|
||||
* The authentication methods to be included for all API calls.
|
||||
|
Loading…
x
Reference in New Issue
Block a user