Browse Source

add support to validation_alias in form when is instance of str and format code

pull/10319/head
Harol Alvarado 1 year ago
parent
commit
ddc04298d9
  1. 5
      fastapi/_compat.py

5
fastapi/_compat.py

@ -88,7 +88,10 @@ if PYDANTIC_V2:
@property
def alias(self) -> str:
a = self.field_info.validation_alias or self.field_info.alias
a = (
isinstance(self.field_info.validation_alias, str)
and self.field_info.validation_alias
) or self.field_info.alias
return a if a is not None else self.name
@property

Loading…
Cancel
Save