You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a job that does some processing and sends its results to stdout in JSON format, e.g. {"name":"job","lines":222,"jobDate":"2023-11-14 07:36:29"}.
I then query Client::pods()->logs($jobPod) to retrieve the output of the job.
src/Repositories/PodRepository.php::logs() is typed to return a string (fine), but the issue is that src/Client.php::sendRequest() will automatically decode JSON into an array, which will trigger a type error when logs() tries to return it.
I'm not sure what the best way to fix this is. Maybe the easiest is to have the logs() function check if the response is an array, and re-encode it?
The text was updated successfully, but these errors were encountered:
I have a job that does some processing and sends its results to stdout in JSON format, e.g.
{"name":"job","lines":222,"jobDate":"2023-11-14 07:36:29"}
.I then query
Client::pods()->logs($jobPod)
to retrieve the output of the job.src/Repositories/PodRepository.php::logs()
is typed to return a string (fine), but the issue is thatsrc/Client.php::sendRequest()
will automatically decode JSON into an array, which will trigger a type error whenlogs()
tries to return it.I'm not sure what the best way to fix this is. Maybe the easiest is to have the
logs()
function check if the response is an array, and re-encode it?The text was updated successfully, but these errors were encountered: