Hi there, I am trying to use pydantic to write nice code but pydantic does not seem to be available at the client side and I am getting serialization errors
Cannot serialize return value from function. Cannot serialize <class ‘LeveeLogicNew.Globals.Project’> object at msg[‘response’]
Here are my classes
from typing import Dict, List
from pydantic import BaseModel
class Cpt(BaseModel):
id: str
project_id: str
lat: float
lon: float
location: str
z: float
name: str
classification: Dict = {}
class Project(BaseModel):
id: str
code: str
description:str
reference_line: Dict = {}
robertson: Dict = {}
cpts: List[Cpt] = []
What is the problem for the serialization? Or shoud I be changing everything to dict’s myself… I was hoping to use Project(**project_dict) from the client side but that is impossible since this will need to import the typing and pydantic packages which are not available.