Don't cast list to tuple in python-prior binding#14014
Don't cast list to tuple in python-prior binding#14014spacether merged 2 commits intoOpenAPITools:masterfrom
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. |
spacether
left a comment
There was a problem hiding this comment.
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. |
b88e33d to
8c2c5c4
Compare
|
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 |
8c2c5c4 to
ac8bc39
Compare
|
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 # successEDIT: 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
ac8bc39 to
afb7cd8
Compare
spacether
left a comment
There was a problem hiding this comment.
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, whosefieldsparameter expects tuples, not lists.cc @spacether
See: https://urllib3.readthedocs.io/en/stable/reference/urllib3.request.html
Fix: #14012