Closed lsklyut closed 2 years ago
What API call results in $json
variable being null
after json_decode
is called in chobie\Jira\Api::api
method?
Please post:
$result
variable value (from var_dump
call), that is returned by JIRA without any transformationsSince we only calling json_decode
, when $result
isn't empty, then likely API results a non-json output, which is isn't good as well.
This is going to take some time to get the debug information - the error is occurring only sometimes and within the library code, so I cannot get any good debug information without forking the package and adding debugging code.
Also in retrospect, maybe allowing a blank response isn't a great solution - if there's not an existing approach to distinguishing a bad response, maybe we throw an ApiException on non-200 responses
@lsklyut , the non-200 responses is a normal thing in REST API, because for example 201 means, that JIRA issue was created.
I'm in no hurry, provide actual debug info when you have time. It's better to wait some time, but to have a solid test cased based on which code needs to be modified, then modifying code without real proof, that it needs changing at all.
This fixes: "Argument 1 passed to chobie//Jira//Api//Result::__construct() must be of the type array, null given, called in /var/www/site/vendor/chobie/jira-api-restclient/src/Jira/Api.php on line 748 and defined...." Potentially, there should be some sort of indication that the result is not a success