-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: maintain pydantic.v1 model compatibility while using pydantic v2 (
#393) * We have pydantic V2 installed in our environemnt, but have been using `from pydantic.v1 import ...`. With the new changes to support pydantic V2 we are wanting to upgrade Spectree to latest and begin writing new serializers, however, we are not ready to update all of our current models to pydantic be pydantic v2 BaseModels. Currently if a ValidationError is raised, the falcon plug in does not catch it, since ValidationError in the plugin is coming from pydantic, not pydantic.v1. Since you are aliasing the pydantic.v1.ValidationError as InternalValidationError, catching it as well allows us to continue to support our v1 models while we migrate to v2 models. Looking at the codebase, this looks like a similar issue in the other plugins. Let me know if you would like me to submit this update for them as well. I'm not sure where you would like a test for this in the project. * update other plugins * test to verify functionality * bump version * update test * make test routes local to test * ruff formatting
- Loading branch information
1 parent
95aff9d
commit 7160ae5
Showing
7 changed files
with
58 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters