jsons
jsons copied to clipboard
SerializationError: object of type 'abc' has no len()
For some reason I cant seem to get a json dump for a pydantic baseModel class object
eg:
import jsons
from pydantic import BaseModel
class abc(BaseModel):
value: int
d = abc(value=1)
jsons.dump(d)
OUTPUT
SerializationError: object of type 'abc' has no len()
EXPECTED The object should serialise fine.
This is using jsons-1.6.3
and pydantic-1.9.1
Hi @duxbuse ,
Interesting. I have actually been thinking about supporting dumping/loading pydantic
models. Right now, it is not supported though.
I would appreciate it, my whole purpose of using jsons is to dump out data classes