forked from loafle/openapi-generator-original
remove hardcoded PetApi (#7483)
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
# do not import all apis into this module because that uses a lot of memory and stack frames
|
||||
# if you need the ability to import all apis from one package, import them with
|
||||
# from {{packageName}.apis import DefaultApi, PetApi
|
||||
# from dynamic_servers.apis import UsageApi
|
||||
|
||||
@@ -729,11 +729,13 @@ class Endpoint(object):
|
||||
def __call__(self, *args, **kwargs):
|
||||
""" This method is invoked when endpoints are called
|
||||
Example:
|
||||
pet_api = PetApi()
|
||||
pet_api.add_pet # this is an instance of the class Endpoint
|
||||
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
||||
|
||||
api_instance = UsageApi()
|
||||
api_instance.custom_server # this is an instance of the class Endpoint
|
||||
api_instance.custom_server() # this invokes api_instance.custom_server.__call__()
|
||||
which then invokes the callable functions stored in that endpoint at
|
||||
pet_api.add_pet.callable or self.callable in this class
|
||||
api_instance.custom_server.callable or self.callable in this class
|
||||
|
||||
"""
|
||||
return self.callable(self, *args, **kwargs)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# raise a `RecursionError`.
|
||||
# In order to avoid this, import only the API that you directly need like:
|
||||
#
|
||||
# from .api.pet_api import PetApi
|
||||
# from .api.usage_api import UsageApi
|
||||
#
|
||||
# or import this package, but before doing it, use:
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user