atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

log_curl_debug messages convey misleading data payloads

Open jason-matthew opened this issue 4 years ago • 1 comments

json.dumps() is leveraged twice prior to writing the request's data payload.

  1. https://github.com/atlassian-api/atlassian-python-api/blob/09ff44afe0b7251dde3ed94da3155f97507129b7/atlassian/rest_client.py#L160
  2. 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"}

jason-matthew avatar Sep 16 '20 16:09 jason-matthew

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

eli-halych avatar Apr 21 '22 13:04 eli-halych