IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

feat: return response text as result intead of the whole object #161

Closed pyrooka closed 1 year ago

pyrooka commented 1 year ago

In case of text responses like text/plain, text/html, etc... the send method returns the whole response object as the result in the DetailedResponse object. This PR changes this behavior so that the send method will return the response text from the body as string. It means it can be accessed directly from the response by calling response.get_result().

padamstx commented 1 year ago

The changes in this PR will require an SDK user to change their code in terms of how a string-based response is received. The app will no longer need to explicitly access the text field of the response, since that's what's now being set in the "result" field. This constitutes a breaking change from the perspective of an app using a Python SDK. We'll need to tread very carefully here and consider the ramifications of this change.

cc: @dpopp07

pyrooka commented 1 year ago

Agree, we should be careful. I treat this PR as a POC for now due to the breaking change it introduces.

pyrooka commented 1 year ago

We agreed on not to merge this feature due to the breaking changes and keep the current behavior, so I'm closing this PR now but won't delete the feature branch in case of we need it in the future.