-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't cast list to tuple in python-prior binding #14014
Conversation
I tested with the following: mvn clean package
sudo update-alternatives --set java java-11-openjdk.x86_64
./bin/generate-samples.sh
./bin/utils/export_docs_generators.sh
mvn clean install
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i ~/Downloads/sample.yaml \
-g python-prior \
-o ~/Downloads/out/ For info on the call to For info on the generation from I have also tested this change against an internal service at my company. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there. This fix looks great but it has no verification test.
Can you please add a test in the tests_manual directory?
If that test is omitted, then this code could be changed in the future, breaking this feature and we would not see any error indicating that something had broken.
Ack, will do. |
WIP, please ignore for now. I will ping when ready for review. Note to self: mvn integration-test -f samples/openapi3/client/petstore/python-prior/pom.xml
cd samples/openapi3/client/petstore/python-prior/
./test_python.sh |
Done. This MR now contains two commits, the first of which adds a test, case, and the second of which adds a code fix: git checkout urllib3~1
./test_python.sh # fail
git checkout urllib3
./test_python.sh # success EDIT: Rebased so that some comments could be tweaked. |
In the spirit of test driven development, this test intentionally fails. A following commit will fix the code to comply with the test. See: OpenAPITools#14012
Tweak the python-prior API bindings, so that they no longer cast lists to tuples when making a POST request with a multipart/form-data content-type. This fixes an interaction with `urllib3.request_encode_body`, whose `fields` parameter expects tuples, not lists. cc @spacether See: https://urllib3.readthedocs.io/en/stable/reference/urllib3.request.html Fix: OpenAPITools#14012
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you for the fix and adding the test!
Tweak the python-prior API bindings, so that they no longer cast lists to tuples when making a POST request with a multipart/form-data content-type. This fixes an interaction with
urllib3.request_encode_body
, whosefields
parameter expects tuples, not lists.cc @spacether
See: https://urllib3.readthedocs.io/en/stable/reference/urllib3.request.html
Fix: #14012