mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-08 09:49:04 +00:00
python(pydantic): Use validate_by_name config; populate_by_name will be deprecated (#22931)
* modules * pydantic bump * samples * revert for fastapi generator and apply pydantic constrain everywhere
This commit is contained in:
@@ -32,7 +32,8 @@ class Bird(BaseModel):
|
||||
__properties: ClassVar[List[str]] = ["size", "color"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -32,7 +32,8 @@ class Category(BaseModel):
|
||||
__properties: ClassVar[List[str]] = ["id", "name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -35,7 +35,8 @@ class DataQuery(Query):
|
||||
__properties: ClassVar[List[str]] = ["id", "outcomes", "suffix", "text", "date"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -50,7 +50,8 @@ class DefaultValue(BaseModel):
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -34,7 +34,8 @@ class NumberPropertiesOnly(BaseModel):
|
||||
__properties: ClassVar[List[str]] = ["number", "float", "double"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -48,7 +48,8 @@ class Pet(BaseModel):
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -43,7 +43,8 @@ class Query(BaseModel):
|
||||
return value
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -32,7 +32,8 @@ class Tag(BaseModel):
|
||||
__properties: ClassVar[List[str]] = ["id", "name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -31,7 +31,8 @@ class TestFormObjectMultipartRequestMarker(BaseModel):
|
||||
__properties: ClassVar[List[str]] = ["name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -34,7 +34,8 @@ class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseMod
|
||||
__properties: ClassVar[List[str]] = ["size", "color", "id", "name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -31,7 +31,8 @@ class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel):
|
||||
__properties: ClassVar[List[str]] = ["values"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
@@ -13,7 +13,7 @@ requires-python = ">=3.9"
|
||||
dependencies = [
|
||||
"urllib3 (>=2.1.0,<3.0.0)",
|
||||
"python-dateutil (>=2.8.2)",
|
||||
"pydantic (>=2)",
|
||||
"pydantic (>=2.11)",
|
||||
"typing-extensions (>=4.7.1)",
|
||||
]
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
urllib3 >= 2.1.0, < 3.0.0
|
||||
python_dateutil >= 2.8.2
|
||||
pydantic >= 2
|
||||
pydantic >= 2.11
|
||||
typing-extensions >= 4.7.1
|
||||
|
||||
@@ -25,7 +25,7 @@ PYTHON_REQUIRES = ">= 3.9"
|
||||
REQUIRES = [
|
||||
"urllib3 >= 2.1.0, < 3.0.0",
|
||||
"python-dateutil >= 2.8.2",
|
||||
"pydantic >= 2",
|
||||
"pydantic >= 2.11",
|
||||
"typing-extensions >= 4.7.1",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user