Hello! I think I've discovered a bug in the Python SDK. I opened a Customer Care case, and they told me to report it here, so here you have the description:
Hello
I have found a bug in the Genesys Cloud Python SDK.
The request
GET /api/v2/integrations/actions/{actionId}/templates/{fileName}
returns a json-serializable string.However, when making the request using the Python SDK:
IntegrationsApi().get_integrations_action_template(action_id, file_name)
The method returns a string that is not json-serializable.
For example, if the endpoint returns this:
"{\"hello\": \"world\"}"
The SDK method returns this:
"{'hello': 'world'}"
Which is not a valid JSON, as it has simple quotes instead of double quotes.
Digging into the SDK's code, I've seen that it may be caused by how it deserializes the API response. In this line it turns the json-string into a python dict, and then it is converted back into a string. And as python dicts use simple quotes, that provokes the bug. I think that when the
response_type
isstr
, it should not try to parse the response string, but return it directly.Could you have a look at it?
Thank you
Edit after Solution: The bug was not that the method should return a JSON serializable string. It should simply return the action template string. However, if that template happened to be JSON serializable, then the SDK would both serialize and deserialize it, modifying it.