Skip to content

Commit

Permalink
Update schemas.py
Browse files Browse the repository at this point in the history
PydanticDeprecatedSince20: Using extra keyword arguments on `Field` is deprecated and will be removed. Use `json_schema_extra` instead. (Extra keys: 'desciption'). Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.4/migration/
  • Loading branch information
sbouillon authored Oct 31, 2023
1 parent 612f36e commit dc4bfec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions fastapi/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@

class PagedCollection(BaseModel, Generic[T]):
count: Annotated[
int,
int,
Field(
...,
desciption="Count of items into the system.\n "
"Replaces the total field which is deprecated",
validation_alias=AliasChoices("count", "total"),
),
json_schema_extra={
'description': "Count of items into the system.\\nReplaces the total field which is deprecated",
'validation_alias': AliasChoices("count", "total")
}
)
]
items: List[T]

Expand Down

0 comments on commit dc4bfec

Please sign in to comment.