fastapi-sessions
fastapi-sessions copied to clipboard
fix: use model_copy instead of copy for pydantic 2 compatibility
In pydantic 2, copy
of a model is deprecated, we should use model_copy
instead.
Migration Guide: https://docs.pydantic.dev/2.0/migration/#migration-guide
For this it would be better to put in dependencies the maximum fastapi version that works with pydantic 1., and only apply this PR with the fastapi version that works with pydantic 2..
It's a breaking change, but since fastapi is on 0.* releases, anything goes
There are other instances where this copy() appears, such as InMemmoryBackend()
, in the code so might want to update them as well.