forked from loafle/openapi-generator-original
updated ApiClient of python sdk.
When create api instance, if we don't pass the `api_client` parameter, then use the default api_client in `config` module.
This commit is contained in:
@@ -31,11 +31,16 @@ from ..util import remove_none
|
||||
|
||||
from ..swagger import ApiClient
|
||||
|
||||
from .. import config
|
||||
|
||||
{{#operations}}
|
||||
class {{classname}}(object):
|
||||
|
||||
def __init__(self, api_client):
|
||||
self.api_client = api_client
|
||||
def __init__(self, api_client=None):
|
||||
if api_client:
|
||||
self.api_client = api_client
|
||||
else:
|
||||
self.api_client = config.api_client
|
||||
{{#operation}}
|
||||
def {{nickname}}(self, {{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}**kwargs):
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
from .swagger import ApiClient
|
||||
|
||||
# Configuration variables
|
||||
|
||||
api_client = ApiClient("{{basePath}}")
|
||||
|
||||
Reference in New Issue
Block a user