atlassian-python-api
atlassian-python-api copied to clipboard
log_curl_debug messages convey misleading data payloads
json.dumps() is leveraged twice prior to writing the request's data payload.
- https://github.com/atlassian-api/atlassian-python-api/blob/09ff44afe0b7251dde3ed94da3155f97507129b7/atlassian/rest_client.py#L160
- https://github.com/atlassian-api/atlassian-python-api/blob/09ff44afe0b7251dde3ed94da3155f97507129b7/atlassian/rest_client.py#L119
Logging statements are not accurate curl statements. Note double quotes are being escaped.
2020-09-16 12:15:10,429 DEBUG curl --silent -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' --data '"{\"body\": {\"storage\": {\"representation\": \"storage\",
Using these curl statements complicates atlassian-python-api debugging given API responses convey a different error from what occurred during python execution
{"statusCode":400,"message":"Can not instantiate value of type [simple type, class com.atlassian.confluence.api.model.content.Content] from JSON String; no single-String constructor/factory method","reason":"Bad Request"}
curl --silent
is another problem - it mutes error messages, which doesn't make sense if you want to debug since you definitely want to see them