Skip to content

Commit 6bc8eb4

Browse files
committed
samples
1 parent 639800c commit 6bc8eb4

166 files changed

Lines changed: 215 additions & 278 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/client/echo_api/python-pydantic-v1/openapi_client/api_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,13 @@ def __deserialize(self, data, klass):
338338
return None
339339

340340
if isinstance(klass, str):
341-
if klass.startswith('List['):
342-
sub_kls = re.match(r'List\[(.*)]', klass).group(1)
341+
if klass.startswith('list['):
342+
sub_kls = re.match(r'list\[(.*)]', klass).group(1)
343343
return [self.__deserialize(sub_data, sub_kls)
344344
for sub_data in data]
345345

346-
if klass.startswith('Dict['):
347-
sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2)
346+
if klass.startswith('dict['):
347+
sub_kls = re.match(r'dict\[([^,]*), (.*)]', klass).group(2)
348348
return {k: self.__deserialize(v, sub_kls)
349349
for k, v in data.items()}
350350

samples/client/echo_api/python-pydantic-v1/openapi_client/api_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""API response object."""
22

33
from __future__ import annotations
4-
from typing import Any, Dict, Optional
4+
from typing import Any, dict, Optional
55
from pydantic import Field, StrictInt, StrictStr
66

77
class ApiResponse:
@@ -10,7 +10,7 @@ class ApiResponse:
1010
"""
1111

1212
status_code: Optional[StrictInt] = Field(None, description="HTTP status code")
13-
headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers")
13+
headers: Optional[dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers")
1414
data: Optional[Any] = Field(None, description="Deserialized data given the data type")
1515
raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)")
1616

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/api_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,13 @@ def __deserialize(self, data, klass):
318318
return None
319319

320320
if isinstance(klass, str):
321-
if klass.startswith('List['):
322-
sub_kls = re.match(r'List\[(.*)]', klass).group(1)
321+
if klass.startswith('list['):
322+
sub_kls = re.match(r'list\[(.*)]', klass).group(1)
323323
return [self.__deserialize(sub_data, sub_kls)
324324
for sub_data in data]
325325

326-
if klass.startswith('Dict['):
327-
sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2)
326+
if klass.startswith('dict['):
327+
sub_kls = re.match(r'dict\[([^,]*), (.*)]', klass).group(2)
328328
return {k: self.__deserialize(v, sub_kls)
329329
for k, v in data.items()}
330330

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/api_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""API response object."""
22

33
from __future__ import annotations
4-
from typing import Any, Dict, Optional
4+
from typing import Any, dict, Optional
55
from pydantic import Field, StrictInt, StrictStr
66

77
class ApiResponse:
@@ -10,7 +10,7 @@ class ApiResponse:
1010
"""
1111

1212
status_code: Optional[StrictInt] = Field(None, description="HTTP status code")
13-
headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers")
13+
headers: Optional[dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers")
1414
data: Optional[Any] = Field(None, description="Deserialized data given the data type")
1515
raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)")
1616

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_any_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AdditionalPropertiesAnyType(BaseModel):
2626
AdditionalPropertiesAnyType
2727
"""
2828
name: Optional[StrictStr] = None
29-
additional_properties: Dict[str, Any] = {}
29+
additional_properties: dict[str, Any] = {}
3030
__properties = ["name"]
3131

3232
class Config:

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AdditionalPropertiesObject(BaseModel):
2626
AdditionalPropertiesObject
2727
"""
2828
name: Optional[StrictStr] = None
29-
additional_properties: Dict[str, Any] = {}
29+
additional_properties: dict[str, Any] = {}
3030
__properties = ["name"]
3131

3232
class Config:

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/additional_properties_with_description_only.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AdditionalPropertiesWithDescriptionOnly(BaseModel):
2626
AdditionalPropertiesWithDescriptionOnly
2727
"""
2828
name: Optional[StrictStr] = None
29-
additional_properties: Dict[str, Any] = {}
29+
additional_properties: dict[str, Any] = {}
3030
__properties = ["name"]
3131

3232
class Config:

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/any_of_color.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from typing import List, Optional
2222
from pydantic import BaseModel, Field, StrictStr, ValidationError, conint, conlist, constr, validator
23-
from typing import Union, Any, List, TYPE_CHECKING
23+
from typing import Union, Any, TYPE_CHECKING
2424
from pydantic import StrictStr, Field
2525

2626
ANYOFCOLOR_ANY_OF_SCHEMAS = ["List[int]", "str"]
@@ -40,7 +40,7 @@ class AnyOfColor(BaseModel):
4040
actual_instance: Union[List[int], str]
4141
else:
4242
actual_instance: Any
43-
any_of_schemas: List[str] = Field(ANYOFCOLOR_ANY_OF_SCHEMAS, const=True)
43+
any_of_schemas: list[str] = Field(ANYOFCOLOR_ANY_OF_SCHEMAS, const=True)
4444

4545
class Config:
4646
validate_assignment = True

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/any_of_pig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
2323
from petstore_api.models.basque_pig import BasquePig
2424
from petstore_api.models.danish_pig import DanishPig
25-
from typing import Union, Any, List, TYPE_CHECKING
25+
from typing import Union, Any, TYPE_CHECKING
2626
from pydantic import StrictStr, Field
2727

2828
ANYOFPIG_ANY_OF_SCHEMAS = ["BasquePig", "DanishPig"]
@@ -40,7 +40,7 @@ class AnyOfPig(BaseModel):
4040
actual_instance: Union[BasquePig, DanishPig]
4141
else:
4242
actual_instance: Any
43-
any_of_schemas: List[str] = Field(ANYOFPIG_ANY_OF_SCHEMAS, const=True)
43+
any_of_schemas: list[str] = Field(ANYOFPIG_ANY_OF_SCHEMAS, const=True)
4444

4545
class Config:
4646
validate_assignment = True

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/color.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from typing import Any, List, Optional
2222
from pydantic import BaseModel, Field, StrictStr, ValidationError, conint, conlist, constr, validator
23-
from typing import Union, Any, List, TYPE_CHECKING
23+
from typing import Union, Any, TYPE_CHECKING
2424
from pydantic import StrictStr, Field
2525

2626
COLOR_ONE_OF_SCHEMAS = ["List[int]", "str"]
@@ -39,7 +39,7 @@ class Color(BaseModel):
3939
actual_instance: Union[List[int], str]
4040
else:
4141
actual_instance: Any
42-
one_of_schemas: List[str] = Field(COLOR_ONE_OF_SCHEMAS, const=True)
42+
one_of_schemas: list[str] = Field(COLOR_ONE_OF_SCHEMAS, const=True)
4343

4444
class Config:
4545
validate_assignment = True

0 commit comments

Comments
 (0)