Closed ff1601com closed 4 years ago
So I just found out it gets json_encoded another time in GitHubClientBase.php on line: 306
if (@count($data))
{
$content = json_encode($data, JSON_FORCE_OBJECT);
}
Since (@count($data))
will always return 1 on a json-object and it will always be a json-object in $data whenever you edit an issue, since it gets json_encoded before, that object will always get encoded a second time, which in my opinion leads to the error 422.
In my opinion one of those json_encodings is too much, either the first or the second one. Or am I missing something?
One example Request that leads to the error is the following:
$client->issues->editAnIssue('myOwner', 'myRepo', null, myNumber, null, null, 'closed', null, null);
Thank a lot, solved here: https://github.com/tan-tan-kanarek/github-php-client/pull/135
Hey there,
I run into a problem when I tried updating the state of an issue.
Whenever I tried to update my issue, I got the following error code:
So naturally I turned on the debug-log and got the following message:
Looks like the json-object got kinda destroyed.
I then tried to remove the following line in your editAnIssue-Function and got it working:
Anyway, if I print out $data after the json encode, it looks just fine.
It almost seems like it gets json_encoded multiple times?
Do you have an idea how this issue arises or how to fix it without removing the
$data = json_encode($data);
- line?