sqlmodel icon indicating copy to clipboard operation
sqlmodel copied to clipboard

Expose pydantic's Field(validation_alias=...) parameter

Open rbubley opened this issue 2 years ago • 2 comments

This eases an issue with Multiple Models (table=True model inheriting from table=False model), where input JSON uses aliases.

rbubley avatar Jan 08 '24 16:01 rbubley

Does this also fix broken field alias since SQLModel 0.0.14? Thanks.

DurandA avatar Jan 08 '24 18:01 DurandA

Does this also fix broken field alias since SQLModel 0.0.14? Thanks.

Almost. In your example in #725 you would need secret_name: str = Field(validation_alias="secretName"), and it then works.

rbubley avatar Jan 09 '24 22:01 rbubley