initializer service deployed and tested
This commit is contained in:
17
api_services/api_validations/pydantic_core.py
Normal file
17
api_services/api_validations/pydantic_core.py
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
|
||||
class BaseModelCore(BaseModel):
|
||||
|
||||
"""
|
||||
BaseModelCore
|
||||
model_dump override for alias support Users.name -> Table[Users] Field(alias="name")
|
||||
"""
|
||||
__abstract__ = True
|
||||
|
||||
class Config:
|
||||
validate_by_name = True
|
||||
use_enum_values = True
|
||||
|
||||
def model_dump(self, *args, **kwargs):
|
||||
data = super().model_dump(*args, **kwargs)
|
||||
return {self.__class__.model_fields[field].alias: value for field, value in data.items()}
|
||||
Reference in New Issue
Block a user