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

Support avatarId key in IssueType, throw Exception if response is not a JSON #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

testfairy
Copy link

Recent changes in Atlassian broke jira-api-restclient.

  1. avatarId is now returned in issueTypes (jira-api-restclient threw Exception upon unrecognised key.)
  2. Accidentally using http://*.atlassian.net instead of https:// will redirect and use GET instead of POST.
  3. Using GET when POST is required would have returned an HTTP error, but CurlClient returned it as a string. Thus, Api.php failed to parse.

@@ -469,6 +470,10 @@ public function api(

if (strlen($result)) {
$json = json_decode($result, true);
if (!is_array($json)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to check for null specifically as this clearly indicates the error. Not sure if that won't backfire if some of API calls really has returns null.

@aik099
Copy link
Collaborator

aik099 commented Feb 27, 2016

avatarId is now returned in issueTypes (jira-api-restclient threw Exception upon unrecognised key.)

Solved as part of #50.

Accidentally using http://*.atlassian.net instead of https:// will redirect and use GET instead of POST.

That is not the problem, that API client needs to be solving. Also JIRA doesn't force you to use HTTPS.

Using GET when POST is required would have returned an HTTP error, but CurlClient returned it as a string. Thus, Api.php failed to parse.

That is not the problem, that API client needs to be solving. Whoever is using the library must supply valid input. Just guessing from the call result if it's failed or not isn't bulletproof solution.

@jpastoor , overall I think this PR needs to be closed.

@aik099
Copy link
Collaborator

aik099 commented May 22, 2016

Please rebase and solve conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants