Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] JSON response #146

Open
chrisvoo opened this issue Oct 30, 2015 · 2 comments
Open

[REQUEST] JSON response #146

chrisvoo opened this issue Oct 30, 2015 · 2 comments
Labels
enhancement pending: help wanted help and PRs are welcome

Comments

@chrisvoo
Copy link

Hi,
thank you for your job. It could be usefull to receive responses also in JSON format for all API by specifing it as a property of the client, instead of a SimpleXmlElement. Now it seems available only for attachments API and issue creation.
Bye :-)

@adamgieron
Copy link

You can encode response as json
return json_encode($whatever);

@Art4
Copy link
Collaborator

Art4 commented Mar 23, 2021

Switching to JSON for all API would need a whole rewrite of all APIs as well as the parameter handling. If someone would take the time for a PR this would be awesome.

As a workaround I would recommend simply parse the SimpleXML to JSON with json_encode:

$issue = $client->getApi('issue')->create($data);

if ($issue instanceof \SimpleXMLElement)
{
    $issueAsJsonString = json_encode($issue);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pending: help wanted help and PRs are welcome
Projects
None yet
Development

No branches or pull requests

3 participants