Skip to content

Conversation

@mbohlool
Copy link
Contributor

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

In order to support streaming responses, we need the API Client not to read response content and return a Response object. urllib3 has a flag called preload_content that if set to False, it will return a urllib3.HTTPResponse. This PR add support for this flag in rest client and api client and generated api classes. The flag is optional and defaulted to True to keep current behavior.

@wing328 wing328 added this to the v2.2.2 milestone Nov 10, 2016
@wing328 wing328 merged commit ba9e449 into swagger-api:master Nov 10, 2016
@wing328
Copy link
Contributor

wing328 commented Nov 10, 2016

@mbohlool thanks for the contribution. If it's not too much to ask, do you mind adding a test case for _preload_content in https://github.com/swagger-api/swagger-codegen/blob/master/samples/client/petstore/python/tests/test_pet_api.py so that the test case won't pass in case some future changes break it?

cc @scottrw93

@mbohlool
Copy link
Contributor Author

@wing328 done #4172

@wing328 wing328 changed the title Support _preload_content flag in python client [Python] Support _preload_content flag in python client Feb 20, 2017
davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
* Modify python client templates to support _preload_content flag

* Update python petstore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants