fix unique items in python nextgen client (#14816)

This commit is contained in:
William Cheng
2023-02-26 10:21:26 +08:00
committed by GitHub
parent 1f2d6b8848
commit b5d4fa9d27
30 changed files with 111 additions and 126 deletions

View File

@@ -19,9 +19,9 @@ from typing_extensions import Annotated
from datetime import date, datetime
from pydantic import Field, StrictBool, StrictInt, StrictStr, confloat, conint, constr, validator
from pydantic import Field, StrictBool, StrictInt, StrictStr, confloat, conint, conlist, constr, validator
from typing import Dict, List, Optional
from typing import Dict, Optional
from petstore_api.models.client import Client
from petstore_api.models.file_schema_test_class import FileSchemaTestClass
@@ -2522,7 +2522,7 @@ class FakeApi(object):
_request_auth=_params.get('_request_auth'))
@validate_arguments
def test_query_parameter_collection_format(self, pipe : List[StrictStr], ioutil : List[StrictStr], http : List[StrictStr], url : List[StrictStr], context : List[StrictStr], allow_empty : StrictStr, language : Optional[Dict[str, StrictStr]] = None, **kwargs) -> None: # noqa: E501
def test_query_parameter_collection_format(self, pipe : conlist(StrictStr), ioutil : conlist(StrictStr), http : conlist(StrictStr), url : conlist(StrictStr), context : conlist(StrictStr), allow_empty : StrictStr, language : Optional[Dict[str, StrictStr]] = None, **kwargs) -> None: # noqa: E501
"""test_query_parameter_collection_format # noqa: E501
To test the collection format in query parameters # noqa: E501
@@ -2565,7 +2565,7 @@ class FakeApi(object):
return self.test_query_parameter_collection_format_with_http_info(pipe, ioutil, http, url, context, allow_empty, language, **kwargs) # noqa: E501
@validate_arguments
def test_query_parameter_collection_format_with_http_info(self, pipe : List[StrictStr], ioutil : List[StrictStr], http : List[StrictStr], url : List[StrictStr], context : List[StrictStr], allow_empty : StrictStr, language : Optional[Dict[str, StrictStr]] = None, **kwargs): # noqa: E501
def test_query_parameter_collection_format_with_http_info(self, pipe : conlist(StrictStr), ioutil : conlist(StrictStr), http : conlist(StrictStr), url : conlist(StrictStr), context : conlist(StrictStr), allow_empty : StrictStr, language : Optional[Dict[str, StrictStr]] = None, **kwargs): # noqa: E501
"""test_query_parameter_collection_format # noqa: E501
To test the collection format in query parameters # noqa: E501

View File

@@ -17,7 +17,7 @@ import re # noqa: F401
from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated
from pydantic import Field, StrictInt, StrictStr, validator
from pydantic import Field, StrictInt, StrictStr, conlist, validator
from typing import List, Optional
@@ -332,7 +332,7 @@ class PetApi(object):
_request_auth=_params.get('_request_auth'))
@validate_arguments
def find_pets_by_status(self, status : Annotated[List[StrictStr], Field(..., description="Status values that need to be considered for filter")], **kwargs) -> List[Pet]: # noqa: E501
def find_pets_by_status(self, status : Annotated[conlist(StrictStr), Field(..., description="Status values that need to be considered for filter")], **kwargs) -> List[Pet]: # noqa: E501
"""Finds Pets by status # noqa: E501
Multiple status values can be provided with comma separated strings # noqa: E501
@@ -363,7 +363,7 @@ class PetApi(object):
return self.find_pets_by_status_with_http_info(status, **kwargs) # noqa: E501
@validate_arguments
def find_pets_by_status_with_http_info(self, status : Annotated[List[StrictStr], Field(..., description="Status values that need to be considered for filter")], **kwargs): # noqa: E501
def find_pets_by_status_with_http_info(self, status : Annotated[conlist(StrictStr), Field(..., description="Status values that need to be considered for filter")], **kwargs): # noqa: E501
"""Finds Pets by status # noqa: E501
Multiple status values can be provided with comma separated strings # noqa: E501
@@ -477,7 +477,7 @@ class PetApi(object):
_request_auth=_params.get('_request_auth'))
@validate_arguments
def find_pets_by_tags(self, tags : Annotated[List[StrictStr], Field(..., description="Tags to filter by", unique_items=True)], **kwargs) -> List[Pet]: # noqa: E501
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
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501
@@ -508,7 +508,7 @@ class PetApi(object):
return self.find_pets_by_tags_with_http_info(tags, **kwargs) # noqa: E501
@validate_arguments
def find_pets_by_tags_with_http_info(self, tags : Annotated[List[StrictStr], Field(..., description="Tags to filter by", unique_items=True)], **kwargs): # noqa: E501
def find_pets_by_tags_with_http_info(self, tags : Annotated[conlist(StrictStr, unique_items=True), Field(..., description="Tags to filter by")], **kwargs): # noqa: E501
"""Finds Pets by tags # noqa: E501
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. # noqa: E501

View File

@@ -17,9 +17,7 @@ import re # noqa: F401
from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated
from pydantic import Field, StrictStr
from typing import List
from pydantic import Field, StrictStr, conlist
from petstore_api.models.user import User
@@ -202,7 +200,7 @@ class UserApi(object):
_request_auth=_params.get('_request_auth'))
@validate_arguments
def create_users_with_array_input(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs) -> None: # noqa: E501
def create_users_with_array_input(self, user : Annotated[conlist(User), Field(..., description="List of user object")], **kwargs) -> None: # noqa: E501
"""Creates list of users with given input array # noqa: E501
# noqa: E501
@@ -233,7 +231,7 @@ class UserApi(object):
return self.create_users_with_array_input_with_http_info(user, **kwargs) # noqa: E501
@validate_arguments
def create_users_with_array_input_with_http_info(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs): # noqa: E501
def create_users_with_array_input_with_http_info(self, user : Annotated[conlist(User), Field(..., description="List of user object")], **kwargs): # noqa: E501
"""Creates list of users with given input array # noqa: E501
# noqa: E501
@@ -346,7 +344,7 @@ class UserApi(object):
_request_auth=_params.get('_request_auth'))
@validate_arguments
def create_users_with_list_input(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs) -> None: # noqa: E501
def create_users_with_list_input(self, user : Annotated[conlist(User), Field(..., description="List of user object")], **kwargs) -> None: # noqa: E501
"""Creates list of users with given input array # noqa: E501
# noqa: E501
@@ -377,7 +375,7 @@ class UserApi(object):
return self.create_users_with_list_input_with_http_info(user, **kwargs) # noqa: E501
@validate_arguments
def create_users_with_list_input_with_http_info(self, user : Annotated[List[User], Field(..., description="List of user object")], **kwargs): # noqa: E501
def create_users_with_list_input_with_http_info(self, user : Annotated[conlist(User), Field(..., description="List of user object")], **kwargs): # noqa: E501
"""Creates list of users with given input array # noqa: E501
# noqa: E501

View File

@@ -16,7 +16,7 @@ import json
import pprint
import re # noqa: F401
from typing import Optional
from typing import List, Optional
from pydantic import BaseModel, Field, StrictStr, ValidationError, conint, conlist, constr, validator
from typing import Any, List
from pydantic import StrictStr, Field

View File

@@ -18,7 +18,7 @@ import json
from typing import List, Optional
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, conlist
class ArrayOfArrayOfNumberOnly(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
@@ -26,7 +26,7 @@ class ArrayOfArrayOfNumberOnly(BaseModel):
Do not edit the class manually.
"""
array_array_number: Optional[List[List[float]]] = Field(None, alias="ArrayArrayNumber")
array_array_number: Optional[conlist(conlist(float))] = Field(None, alias="ArrayArrayNumber")
__properties = ["ArrayArrayNumber"]
class Config:

View File

@@ -18,7 +18,7 @@ import json
from typing import List, Optional
from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, conlist
class ArrayOfNumberOnly(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
@@ -26,7 +26,7 @@ class ArrayOfNumberOnly(BaseModel):
Do not edit the class manually.
"""
array_number: Optional[List[float]] = Field(None, alias="ArrayNumber")
array_number: Optional[conlist(float)] = Field(None, alias="ArrayNumber")
__properties = ["ArrayNumber"]
class Config:

View File

@@ -28,8 +28,8 @@ class ArrayTest(BaseModel):
Do not edit the class manually.
"""
array_of_string: Optional[conlist(StrictStr, max_items=3, min_items=0)] = None
array_array_of_integer: Optional[List[List[StrictInt]]] = None
array_array_of_model: Optional[List[List[ReadOnlyFirst]]] = None
array_array_of_integer: Optional[conlist(conlist(StrictInt))] = None
array_array_of_model: Optional[conlist(conlist(ReadOnlyFirst))] = None
__properties = ["array_of_string", "array_array_of_integer", "array_array_of_model"]
class Config:

View File

@@ -18,7 +18,7 @@ import json
from typing import List, Optional
from pydantic import BaseModel, StrictStr, validator
from pydantic import BaseModel, StrictStr, conlist, validator
class EnumArrays(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
@@ -27,7 +27,7 @@ class EnumArrays(BaseModel):
Do not edit the class manually.
"""
just_symbol: Optional[StrictStr] = None
array_enum: Optional[List[StrictStr]] = None
array_enum: Optional[conlist(StrictStr)] = None
__properties = ["just_symbol", "array_enum"]
@validator('just_symbol')

View File

@@ -18,7 +18,7 @@ import json
from typing import List, Optional
from pydantic import BaseModel
from pydantic import BaseModel, conlist
from petstore_api.models.file import File
class FileSchemaTestClass(BaseModel):
@@ -28,7 +28,7 @@ class FileSchemaTestClass(BaseModel):
Do not edit the class manually.
"""
file: Optional[File] = None
files: Optional[List[File]] = None
files: Optional[conlist(File)] = None
__properties = ["file", "files"]
class Config:

View File

@@ -18,7 +18,7 @@ import json
from datetime import date, datetime
from typing import Any, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, conlist
class NullableClass(BaseModel):
"""NOTE: This class is auto generated by OpenAPI Generator.
@@ -33,9 +33,9 @@ class NullableClass(BaseModel):
string_prop: Optional[StrictStr] = None
date_prop: Optional[date] = None
datetime_prop: Optional[datetime] = None
array_nullable_prop: Optional[List[Dict[str, Any]]] = None
array_and_items_nullable_prop: Optional[List[Dict[str, Any]]] = None
array_items_nullable: Optional[List[Dict[str, Any]]] = None
array_nullable_prop: Optional[conlist(Dict[str, Any])] = None
array_and_items_nullable_prop: Optional[conlist(Dict[str, Any])] = None
array_items_nullable: Optional[conlist(Dict[str, Any])] = None
object_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
object_and_items_nullable_prop: Optional[Dict[str, Dict[str, Any]]] = None
object_items_nullable: Optional[Dict[str, Dict[str, Any]]] = None

View File

@@ -18,7 +18,7 @@ import json
from typing import List, Optional
from pydantic import BaseModel, Field, StrictStr
from pydantic import BaseModel, Field, StrictStr, conlist
from petstore_api.models.deprecated_object import DeprecatedObject
class ObjectWithDeprecatedFields(BaseModel):
@@ -30,7 +30,7 @@ class ObjectWithDeprecatedFields(BaseModel):
uuid: Optional[StrictStr] = None
id: Optional[float] = None
deprecated_ref: Optional[DeprecatedObject] = Field(None, alias="deprecatedRef")
bars: Optional[List[StrictStr]] = None
bars: Optional[conlist(StrictStr)] = None
__properties = ["uuid", "id", "deprecatedRef", "bars"]
class Config:

View File

@@ -18,7 +18,7 @@ import json
from typing import List, Optional
from pydantic import BaseModel, Field, StrictInt, StrictStr, validator
from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist, validator
from petstore_api.models.category import Category
from petstore_api.models.tag import Tag
@@ -31,8 +31,8 @@ class Pet(BaseModel):
id: Optional[StrictInt] = None
category: Optional[Category] = None
name: StrictStr = ...
photo_urls: List[StrictStr] = Field(..., alias="photoUrls", unique_items=True)
tags: Optional[List[Tag]] = None
photo_urls: conlist(StrictStr, min_items=0, unique_items=True) = Field(..., alias="photoUrls")
tags: Optional[conlist(Tag)] = None
status: Optional[StrictStr] = Field(None, description="pet status in the store")
__properties = ["id", "category", "name", "photoUrls", "tags", "status"]