from typing import Annotated
from pydantic import BaseModel, BeforeValidator, Field
class A(BaseModel):
a: Annotated[int, BeforeValidator(lambda x: x + 1)] = Field(None) # cannot specify `Annotated` and value `Field`s together for 'a'
print(A(a=1))
Maybe this was true for Pydantic 1 or something?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too