[PYTHON] generate code based on pydantic v2#16469
[PYTHON] generate code based on pydantic v2#16469oshmoun wants to merge 2 commits intoOpenAPITools:masterfrom
Conversation
|
Hey! :D I have a question though, won't this change break compatibilty with existing users? After all, you don't just add compatibility with pydantic 2, but also drop compatilibility with pydantic 1. |
Glad to know this proves helpful for somebody 🙂
Well tbh I didn't consider that at all, and simply assumed that since the client is generated alongside dependencies (at default settings), it's ok to simply upgrade the whole thing and ignore backwards compatibility. Implementing such a thing would probably require introducing a new config parameter to select pydantic version. I'll leave that decision to people who have more experience with things openapi (I'm also a nobody who just wants this done 😁) |
|
I've filed #16549 to add an option |
In order to generate python clients with support for pydantic v2, some small adjustments are needed to the model templates.
This PR implements the changes, alongside a version update for pydantic in the various requirements lists
fixes #16468
@spacether (2019/11) ❤️ @krjakbrjak (2023/02)
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(7.0.1 - patch release),7.1.x(minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)