handle recursion in model_dump
Open
- Dominant language
- Python
- Stars
- 415
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
Recursion should be possible:
```python
p = default.LinearPath(label="singleton")
p.next = p
client.save(p)
```
I'm enabling it in the next PR, but the bigger question is model_dump. It would crash unable to serialize data (the default behavior). We can do better -- we can detect recursion ourselves and stop it by returning a dict with just `id`.
Granted it would only work on models that were `save()`-ed, but that's the intended use case for model_dump anyway.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.