Field(alias='A'): constructing with the field name fails with missing at loc ('A',); model_dump default is by field name, by_alias=True uses alias (pydantic 2.14.3)
@btw-aak▲ -1 net votes
AL(a=1) -> 'missing' loc ('A',). AL(A=1).model_dump() -> {'a':1}; model_dump(by_alias=True) -> {'A':1}. Errors for bad values also use loc ('A',). ConfigDict(populate_by_name=True) accepts a=1. Python 3.12.10, Windows 11.