mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 00:43:46 +00:00
[python] change Private attr to Class vars (#16687)
* [python] fix TypeError Signed-off-by: ふぁ <yuki@yuki0311.com> * [python] update Private model attributes to Class vars Signed-off-by: ふぁ <yuki@yuki0311.com> * [python] rename the List of test cases to ListClass Signed-off-by: ふぁ <yuki@yuki0311.com> * [python] update samples Signed-off-by: ふぁ <yuki@yuki0311.com> * [python] rename the List of v1 test cases to ListClass Signed-off-by: ふぁ <yuki@yuki0311.com> * [python] rename the List of v1-aiohttp test cases to ListClass Signed-off-by: ふぁ <yuki@yuki0311.com> * update samples --------- Signed-off-by: ふぁ <yuki@yuki0311.com> Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
@@ -28,7 +28,7 @@ class Bird(BaseModel):
|
||||
"""
|
||||
size: Optional[StrictStr] = None
|
||||
color: Optional[StrictStr] = None
|
||||
__properties = ["size", "color"]
|
||||
__properties: ClassVar[List[str]] = ["size", "color"]
|
||||
|
||||
model_config = {
|
||||
"populate_by_name": True,
|
||||
|
||||
@@ -28,7 +28,7 @@ class Category(BaseModel):
|
||||
"""
|
||||
id: Optional[StrictInt] = None
|
||||
name: Optional[StrictStr] = None
|
||||
__properties = ["id", "name"]
|
||||
__properties: ClassVar[List[str]] = ["id", "name"]
|
||||
|
||||
model_config = {
|
||||
"populate_by_name": True,
|
||||
|
||||
@@ -31,7 +31,7 @@ class DataQuery(Query):
|
||||
suffix: Optional[StrictStr] = Field(default=None, description="test suffix")
|
||||
text: Optional[StrictStr] = Field(default=None, description="Some text containing white spaces")
|
||||
var_date: Optional[datetime] = Field(default=None, description="A date", alias="date")
|
||||
__properties = ["id", "outcomes", "suffix", "text", "date"]
|
||||
__properties: ClassVar[List[str]] = ["id", "outcomes", "suffix", "text", "date"]
|
||||
|
||||
model_config = {
|
||||
"populate_by_name": True,
|
||||
|
||||
@@ -35,7 +35,7 @@ class DefaultValue(BaseModel):
|
||||
array_string_nullable: Optional[List[StrictStr]] = None
|
||||
array_string_extension_nullable: Optional[List[StrictStr]] = None
|
||||
string_nullable: Optional[StrictStr] = None
|
||||
__properties = ["array_string_enum_ref_default", "array_string_enum_default", "array_string_default", "array_integer_default", "array_string", "array_string_nullable", "array_string_extension_nullable", "string_nullable"]
|
||||
__properties: ClassVar[List[str]] = ["array_string_enum_ref_default", "array_string_enum_default", "array_string_default", "array_integer_default", "array_string", "array_string_nullable", "array_string_extension_nullable", "string_nullable"]
|
||||
|
||||
@field_validator('array_string_enum_default')
|
||||
def array_string_enum_default_validate_enum(cls, value):
|
||||
|
||||
@@ -30,7 +30,7 @@ class NumberPropertiesOnly(BaseModel):
|
||||
"""
|
||||
number: Optional[Union[StrictFloat, StrictInt]] = None
|
||||
double: Optional[Union[Annotated[float, Field(le=50.2, strict=True, ge=0.8)], Annotated[int, Field(le=50, strict=True, ge=1)]]] = None
|
||||
__properties = ["number", "double"]
|
||||
__properties: ClassVar[List[str]] = ["number", "double"]
|
||||
|
||||
model_config = {
|
||||
"populate_by_name": True,
|
||||
|
||||
@@ -35,7 +35,7 @@ class Pet(BaseModel):
|
||||
photo_urls: List[StrictStr] = Field(alias="photoUrls")
|
||||
tags: Optional[List[Tag]] = None
|
||||
status: Optional[StrictStr] = Field(default=None, description="pet status in the store")
|
||||
__properties = ["id", "name", "category", "photoUrls", "tags", "status"]
|
||||
__properties: ClassVar[List[str]] = ["id", "name", "category", "photoUrls", "tags", "status"]
|
||||
|
||||
@field_validator('status')
|
||||
def status_validate_enum(cls, value):
|
||||
|
||||
@@ -29,7 +29,7 @@ class Query(BaseModel):
|
||||
"""
|
||||
id: Optional[StrictInt] = Field(default=None, description="Query")
|
||||
outcomes: Optional[List[StrictStr]] = None
|
||||
__properties = ["id", "outcomes"]
|
||||
__properties: ClassVar[List[str]] = ["id", "outcomes"]
|
||||
|
||||
@field_validator('outcomes')
|
||||
def outcomes_validate_enum(cls, value):
|
||||
|
||||
@@ -28,7 +28,7 @@ class Tag(BaseModel):
|
||||
"""
|
||||
id: Optional[StrictInt] = None
|
||||
name: Optional[StrictStr] = None
|
||||
__properties = ["id", "name"]
|
||||
__properties: ClassVar[List[str]] = ["id", "name"]
|
||||
|
||||
model_config = {
|
||||
"populate_by_name": True,
|
||||
|
||||
@@ -30,7 +30,7 @@ class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseMod
|
||||
color: Optional[StrictStr] = None
|
||||
id: Optional[StrictInt] = None
|
||||
name: Optional[StrictStr] = None
|
||||
__properties = ["size", "color", "id", "name"]
|
||||
__properties: ClassVar[List[str]] = ["size", "color", "id", "name"]
|
||||
|
||||
model_config = {
|
||||
"populate_by_name": True,
|
||||
|
||||
@@ -27,7 +27,7 @@ class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel):
|
||||
TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
"""
|
||||
values: Optional[List[StrictStr]] = None
|
||||
__properties = ["values"]
|
||||
__properties: ClassVar[List[str]] = ["values"]
|
||||
|
||||
model_config = {
|
||||
"populate_by_name": True,
|
||||
|
||||
Reference in New Issue
Block a user