fastapi-sessions icon indicating copy to clipboard operation
fastapi-sessions copied to clipboard

fix: use model_copy instead of copy for pydantic 2 compatibility

Open neubi4 opened this issue 1 year ago • 2 comments

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

neubi4 avatar Jul 11 '23 05:07 neubi4

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

rafalkrupinski avatar Sep 01 '23 10:09 rafalkrupinski

There are other instances where this copy() appears, such as InMemmoryBackend(), in the code so might want to update them as well.

wisdomtooth546 avatar Sep 22 '23 06:09 wisdomtooth546