forked from loafle/openapi-generator-original
[Python] remove singleton (#5012)
* updated tests relying on configuration's singleton * regenerated samples * removed singleton from templates * regenerated samples * removed broken sample and its test * reverted accidental change * regenerated security/ samples * removed singleton from RESTClientObject * removed unused Configuration import * reverted unrelated change * updated usage examples in api_doc template
This commit is contained in:
@@ -11,7 +11,6 @@ import re
|
||||
# python 2 and python 3 compatibility library
|
||||
from six import iteritems
|
||||
|
||||
from ..configuration import Configuration
|
||||
from ..api_client import ApiClient
|
||||
|
||||
|
||||
@@ -24,13 +23,9 @@ class {{classname}}(object):
|
||||
"""
|
||||
|
||||
def __init__(self, api_client=None):
|
||||
config = Configuration()
|
||||
if api_client:
|
||||
self.api_client = api_client
|
||||
else:
|
||||
if not config.api_client:
|
||||
config.api_client = ApiClient()
|
||||
self.api_client = config.api_client
|
||||
if api_client is None:
|
||||
api_client = ApiClient()
|
||||
self.api_client = api_client
|
||||
{{#operation}}
|
||||
|
||||
def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs):
|
||||
|
||||
Reference in New Issue
Block a user