sqlmodel icon indicating copy to clipboard operation
sqlmodel copied to clipboard

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

Open evotodi opened this issue 1 year ago • 2 comments

This expands upon and closes PR #774 by adding serialization_alias and missing Field override parameters.

Allows for serializing json using serialization_alias when by_alias is true object.model_dump_json(by_alias=True)

evotodi avatar Jun 18 '24 17:06 evotodi

Dear all, it would be totally awesome to release this. The issue exists several months and several versions already https://github.com/tiangolo/sqlmodel/discussions/725. Please, let's get some traction here :)

khrapovs avatar Jul 26 '24 13:07 khrapovs

second the push to get this merged as soon as possible please 🙏 I have to map thousands (yes thousands) of field names from a third-party API onto a local DB with different column names, and having to write schema_extra={"validation_alias": "some_thirdparty_name"}) hundreds of times is a chore.

HeiziND avatar Aug 08 '24 06:08 HeiziND