forked from loafle/openapi-generator-original
Add @deprecated to methods in python-nextgen (#15380)
* add @deprecated to methods in python-nextgen * add deprecated as comment * add deprecation warnings * add warnings import * remove import
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated{{#asyncio}}
|
||||
@@ -47,7 +48,7 @@ class {{classname}}(object):
|
||||
{{/asyncio}}
|
||||
@validate_arguments
|
||||
def {{operationId}}(self, {{#allParams}}{{paramName}} : {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, {{/allParams}}{{#asyncio}}async_req: Optional[bool]=None, {{/asyncio}}**kwargs) -> {{#asyncio}}Union[{{{returnType}}}{{^returnType}}None{{/returnType}}, Awaitable[{{{returnType}}}{{^returnType}}None{{/returnType}}]]{{/asyncio}}{{^asyncio}}{{{returnType}}}{{^returnType}}None{{/returnType}}{{/asyncio}}: # noqa: E501
|
||||
"""{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
|
||||
"""{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
|
||||
|
||||
{{#notes}}
|
||||
{{{.}}} # noqa: E501
|
||||
@@ -84,7 +85,7 @@ class {{classname}}(object):
|
||||
|
||||
@validate_arguments
|
||||
def {{operationId}}_with_http_info(self, {{#allParams}}{{paramName}} : {{{vendorExtensions.x-py-typing}}}{{^required}} = None{{/required}}, {{/allParams}}**kwargs) -> ApiResponse: # noqa: E501
|
||||
"""{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
|
||||
"""{{#isDeprecated}}(Deprecated) {{/isDeprecated}}{{{summary}}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501
|
||||
|
||||
{{#notes}}
|
||||
{{{.}}} # noqa: E501
|
||||
@@ -124,6 +125,10 @@ class {{classname}}(object):
|
||||
:rtype: {{#returnType}}tuple({{.}}, status_code(int), headers(HTTPHeaderDict)){{/returnType}}{{^returnType}}None{{/returnType}}
|
||||
"""
|
||||
|
||||
{{#isDeprecated}}
|
||||
warnings.warn("{{{httpMethod}}} {{{path}}} is deprecated.", DeprecationWarning)
|
||||
|
||||
{{/isDeprecated}}
|
||||
{{#servers.0}}
|
||||
_hosts = [
|
||||
{{#servers}}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
```python
|
||||
from __future__ import print_function
|
||||
{{#apiInfo}}{{#apis}}{{#-last}}{{#hasHttpSignatureMethods}}import datetime{{/hasHttpSignatureMethods}}{{/-last}}{{/apis}}{{/apiInfo}}
|
||||
import time
|
||||
import {{{packageName}}}
|
||||
|
||||
@@ -49,7 +49,6 @@ Execute `pytest` to run the tests.
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
|
||||
import time
|
||||
import openapi_client
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -49,7 +49,6 @@ Execute `pytest` to run the tests.
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import datetime
|
||||
import time
|
||||
import petstore_api
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
@@ -508,7 +509,7 @@ class PetApi(object):
|
||||
|
||||
@validate_arguments
|
||||
def find_pets_by_tags(self, tags : Annotated[conlist(StrictStr, unique_items=True), Field(..., description="Tags to filter by")], async_req: Optional[bool]=None, **kwargs) -> Union[List[Pet], Awaitable[List[Pet]]]: # noqa: E501
|
||||
"""Finds Pets by tags # noqa: E501
|
||||
"""(Deprecated) Finds Pets by tags # noqa: E501
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
@@ -539,7 +540,7 @@ class PetApi(object):
|
||||
|
||||
@validate_arguments
|
||||
def find_pets_by_tags_with_http_info(self, tags : Annotated[conlist(StrictStr, unique_items=True), Field(..., description="Tags to filter by")], **kwargs) -> ApiResponse: # noqa: E501
|
||||
"""Finds Pets by tags # noqa: E501
|
||||
"""(Deprecated) Finds Pets by tags # noqa: E501
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
@@ -575,6 +576,8 @@ class PetApi(object):
|
||||
:rtype: tuple(List[Pet], status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
warnings.warn("GET /pet/findByTags is deprecated.", DeprecationWarning)
|
||||
|
||||
_params = locals()
|
||||
|
||||
_all_params = [
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -49,7 +49,6 @@ Execute `pytest` to run the tests.
|
||||
Please follow the [installation procedure](#installation--usage) and then run the following:
|
||||
|
||||
```python
|
||||
from __future__ import print_function
|
||||
import datetime
|
||||
import time
|
||||
import petstore_api
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
@@ -469,7 +470,7 @@ class PetApi(object):
|
||||
|
||||
@validate_arguments
|
||||
def find_pets_by_tags(self, tags : Annotated[conlist(StrictStr, unique_items=True), Field(..., description="Tags to filter by")], **kwargs) -> List[Pet]: # noqa: E501
|
||||
"""Finds Pets by tags # noqa: E501
|
||||
"""(Deprecated) Finds Pets by tags # noqa: E501
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
@@ -498,7 +499,7 @@ class PetApi(object):
|
||||
|
||||
@validate_arguments
|
||||
def find_pets_by_tags_with_http_info(self, tags : Annotated[conlist(StrictStr, unique_items=True), Field(..., description="Tags to filter by")], **kwargs) -> ApiResponse: # noqa: E501
|
||||
"""Finds Pets by tags # noqa: E501
|
||||
"""(Deprecated) Finds Pets by tags # noqa: E501
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
@@ -534,6 +535,8 @@ class PetApi(object):
|
||||
:rtype: tuple(List[Pet], status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
warnings.warn("GET /pet/findByTags is deprecated.", DeprecationWarning)
|
||||
|
||||
_params = locals()
|
||||
|
||||
_all_params = [
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
import re # noqa: F401
|
||||
import io
|
||||
import warnings
|
||||
|
||||
from pydantic import validate_arguments, ValidationError
|
||||
from typing_extensions import Annotated
|
||||
|
||||
Reference in New Issue
Block a user