-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
It would be helpful if it were possible to create a serialization configuration set automatically based on a Pydantic model (schema).
The specific intended use would be streamline development in a FastAPI context, and to eliminate the need to maintain parallel serialization/deserialization schemas when using SQLAthanor in an application that is also using Pydantic models (read: the vast majority of FastAPI implementations).
The syntax envisioned for this would be something along the lines of:
- add Pydantic model and iterable of Pydantic model as an additional supported type for the
configargument passed tovalidate_serialization_config() - enable the
BaseModel.set_attribute_serialization_config()andBaseModel.configure_serialization()methods to accept Pydantic models as their config sets - add an
AttributeConfiguration.from_pydantic()class method that will generate an attribute configuration based on a Pydantic model
Note that the solution developed will need support the application of multiple config_set settings, where each config_set will be built off of a separate Pydantic model.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request