forked from loafle/openapi-generator-original
remove hardcoded PetApi (#7483)
This commit is contained in:
parent
04b39cc86b
commit
8c78f13a41
@ -1,3 +1,9 @@
|
|||||||
|
{{#apiInfo}}
|
||||||
|
{{#apis}}
|
||||||
|
{{#-first}}
|
||||||
# do not import all apis into this module because that uses a lot of memory and stack frames
|
# 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
|
# if you need the ability to import all apis from one package, import them with
|
||||||
# from {{packageName}.apis import DefaultApi, PetApi
|
# from {{packageName}}.apis import {{classname}}
|
||||||
|
{{/-first}}
|
||||||
|
{{/apis}}
|
||||||
|
{{/apiInfo}}
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
{{#apiInfo}}
|
||||||
|
{{#apis}}
|
||||||
|
{{#-first}}
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
@ -7,7 +10,7 @@
|
|||||||
# raise a `RecursionError`.
|
# raise a `RecursionError`.
|
||||||
# In order to avoid this, import only the API that you directly need like:
|
# In order to avoid this, import only the API that you directly need like:
|
||||||
#
|
#
|
||||||
# from {{packagename}}.api.pet_api import PetApi
|
# from {{packagename}}.api.{{classVarName}} import {{classname}}
|
||||||
#
|
#
|
||||||
# or import this package, but before doing it, use:
|
# or import this package, but before doing it, use:
|
||||||
#
|
#
|
||||||
@ -15,8 +18,7 @@
|
|||||||
# sys.setrecursionlimit(n)
|
# sys.setrecursionlimit(n)
|
||||||
|
|
||||||
# Import APIs into API package:
|
# Import APIs into API package:
|
||||||
{{#apiInfo}}
|
{{/-first}}
|
||||||
{{#apis}}
|
|
||||||
from {{apiPackage}}.{{classVarName}} import {{classname}}
|
from {{apiPackage}}.{{classVarName}} import {{classname}}
|
||||||
{{/apis}}
|
{{/apis}}
|
||||||
{{/apiInfo}}
|
{{/apiInfo}}
|
||||||
|
@ -750,11 +750,13 @@ class Endpoint(object):
|
|||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
""" This method is invoked when endpoints are called
|
""" This method is invoked when endpoints are called
|
||||||
Example:
|
Example:
|
||||||
pet_api = PetApi()
|
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
|
||||||
pet_api.add_pet # this is an instance of the class Endpoint
|
api_instance = {{classname}}()
|
||||||
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
api_instance.{{operationId}} # this is an instance of the class Endpoint
|
||||||
|
api_instance.{{operationId}}() # this invokes api_instance.{{operationId}}.__call__()
|
||||||
which then invokes the callable functions stored in that endpoint at
|
which then invokes the callable functions stored in that endpoint at
|
||||||
pet_api.add_pet.callable or self.callable in this class
|
api_instance.{{operationId}}.callable or self.callable in this class
|
||||||
|
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
|
||||||
"""
|
"""
|
||||||
return self.callable(self, *args, **kwargs)
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# do not import all apis into this module because that uses a lot of memory and stack frames
|
# 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
|
# if you need the ability to import all apis from one package, import them with
|
||||||
# from {{packageName}.apis import DefaultApi, PetApi
|
# from petstore_api.apis import AnotherFakeApi
|
||||||
|
@ -729,11 +729,13 @@ class Endpoint(object):
|
|||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
""" This method is invoked when endpoints are called
|
""" This method is invoked when endpoints are called
|
||||||
Example:
|
Example:
|
||||||
pet_api = PetApi()
|
|
||||||
pet_api.add_pet # this is an instance of the class Endpoint
|
api_instance = AnotherFakeApi()
|
||||||
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
api_instance.call_123_test_special_tags # this is an instance of the class Endpoint
|
||||||
|
api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__()
|
||||||
which then invokes the callable functions stored in that endpoint at
|
which then invokes the callable functions stored in that endpoint at
|
||||||
pet_api.add_pet.callable or self.callable in this class
|
api_instance.call_123_test_special_tags.callable or self.callable in this class
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return self.callable(self, *args, **kwargs)
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# raise a `RecursionError`.
|
# raise a `RecursionError`.
|
||||||
# In order to avoid this, import only the API that you directly need like:
|
# In order to avoid this, import only the API that you directly need like:
|
||||||
#
|
#
|
||||||
# from .api.pet_api import PetApi
|
# from .api.another_fake_api import AnotherFakeApi
|
||||||
#
|
#
|
||||||
# or import this package, but before doing it, use:
|
# or import this package, but before doing it, use:
|
||||||
#
|
#
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# do not import all apis into this module because that uses a lot of memory and stack frames
|
# 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
|
# if you need the ability to import all apis from one package, import them with
|
||||||
# from {{packageName}.apis import DefaultApi, PetApi
|
# from x_auth_id_alias.apis import UsageApi
|
||||||
|
@ -729,11 +729,13 @@ class Endpoint(object):
|
|||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
""" This method is invoked when endpoints are called
|
""" This method is invoked when endpoints are called
|
||||||
Example:
|
Example:
|
||||||
pet_api = PetApi()
|
|
||||||
pet_api.add_pet # this is an instance of the class Endpoint
|
api_instance = UsageApi()
|
||||||
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
api_instance.any_key # this is an instance of the class Endpoint
|
||||||
|
api_instance.any_key() # this invokes api_instance.any_key.__call__()
|
||||||
which then invokes the callable functions stored in that endpoint at
|
which then invokes the callable functions stored in that endpoint at
|
||||||
pet_api.add_pet.callable or self.callable in this class
|
api_instance.any_key.callable or self.callable in this class
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return self.callable(self, *args, **kwargs)
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# raise a `RecursionError`.
|
# raise a `RecursionError`.
|
||||||
# In order to avoid this, import only the API that you directly need like:
|
# 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:
|
# or import this package, but before doing it, use:
|
||||||
#
|
#
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# do not import all apis into this module because that uses a lot of memory and stack frames
|
# 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
|
# 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):
|
def __call__(self, *args, **kwargs):
|
||||||
""" This method is invoked when endpoints are called
|
""" This method is invoked when endpoints are called
|
||||||
Example:
|
Example:
|
||||||
pet_api = PetApi()
|
|
||||||
pet_api.add_pet # this is an instance of the class Endpoint
|
api_instance = UsageApi()
|
||||||
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
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
|
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)
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# raise a `RecursionError`.
|
# raise a `RecursionError`.
|
||||||
# In order to avoid this, import only the API that you directly need like:
|
# 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:
|
# or import this package, but before doing it, use:
|
||||||
#
|
#
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# do not import all apis into this module because that uses a lot of memory and stack frames
|
# 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
|
# if you need the ability to import all apis from one package, import them with
|
||||||
# from {{packageName}.apis import DefaultApi, PetApi
|
# from petstore_api.apis import AnotherFakeApi
|
||||||
|
@ -736,11 +736,13 @@ class Endpoint(object):
|
|||||||
def __call__(self, *args, **kwargs):
|
def __call__(self, *args, **kwargs):
|
||||||
""" This method is invoked when endpoints are called
|
""" This method is invoked when endpoints are called
|
||||||
Example:
|
Example:
|
||||||
pet_api = PetApi()
|
|
||||||
pet_api.add_pet # this is an instance of the class Endpoint
|
api_instance = AnotherFakeApi()
|
||||||
pet_api.add_pet() # this invokes pet_api.add_pet.__call__()
|
api_instance.call_123_test_special_tags # this is an instance of the class Endpoint
|
||||||
|
api_instance.call_123_test_special_tags() # this invokes api_instance.call_123_test_special_tags.__call__()
|
||||||
which then invokes the callable functions stored in that endpoint at
|
which then invokes the callable functions stored in that endpoint at
|
||||||
pet_api.add_pet.callable or self.callable in this class
|
api_instance.call_123_test_special_tags.callable or self.callable in this class
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return self.callable(self, *args, **kwargs)
|
return self.callable(self, *args, **kwargs)
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
# raise a `RecursionError`.
|
# raise a `RecursionError`.
|
||||||
# In order to avoid this, import only the API that you directly need like:
|
# In order to avoid this, import only the API that you directly need like:
|
||||||
#
|
#
|
||||||
# from .api.pet_api import PetApi
|
# from .api.another_fake_api import AnotherFakeApi
|
||||||
#
|
#
|
||||||
# or import this package, but before doing it, use:
|
# or import this package, but before doing it, use:
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user