feat(api): implement PydanticModelEncoder for JSON serialization
Use `PydanticModelEncoder` for JSON serialization while persisting node execution data.pull/20699/head
parent
77ec5f3f68
commit
03f91daa27
@ -0,0 +1,11 @@
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class PydanticModelEncoder(json.JSONEncoder):
|
||||
def default(self, o):
|
||||
if isinstance(o, BaseModel):
|
||||
return o.model_dump()
|
||||
else:
|
||||
super().default(o)
|
||||
Loading…
Reference in New Issue