mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-09 02:28:58 +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=(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user