AvdLee / appstoreconnect-swift-sdk

The Swift SDK to work with the App Store Connect API from Apple.
Other
1.48k stars 198 forks source link

`CiGitUser.avatarUrl` fails to decode an empty string #253

Closed hiltonc closed 9 months ago

hiltonc commented 11 months ago

Same as #240, when doing a create build run request the CiBuildRunResponse contains a CiGitUser object. The response path data.attributes.sourceCommit.author.avaterUrl can contain an empty string which fails to decode.

Error: Failed to decode response:
{
  "data" : {
    "type" : "ciBuildRuns",
    "id" : "9461d71a-0fb3-43ed-9b7a-e154fed69742",
    "attributes" : {
      "number" : 415,
      "createdDate" : "2023-12-15T20:55:48.521Z",
      "startedDate" : null,
      "finishedDate" : null,
      "sourceCommit" : {
        "commitSha" : "",
        "message" : "",
        "author" : {
          "displayName" : "",
          "avatarUrl" : ""
        },
        "committer" : {
          "displayName" : "",
          "avatarUrl" : ""
        },
        "webUrl" : ""
      },
      "destinationCommit" : null,
      "isPullRequestBuild" : false,
      "issueCounts" : null,
      "executionProgress" : "PENDING",
      "completionStatus" : null,
      "startReason" : "MANUAL",
      "cancelReason" : null
    },
    "relationships" : {
      "builds" : {
        "links" : {
          "self" : "https://api.appstoreconnect.apple.com/v1/ciBuildRuns/9461d71a-0fb3-43ed-9b7a-e154fed69742/relationships/builds",
          "related" : "https://api.appstoreconnect.apple.com/v1/ciBuildRuns/9461d71a-0fb3-43ed-9b7a-e154fed69742/builds"
        }
      },
      "actions" : {
        "links" : {
          "self" : "https://api.appstoreconnect.apple.com/v1/ciBuildRuns/9461d71a-0fb3-43ed-9b7a-e154fed69742/relationships/actions",
          "related" : "https://api.appstoreconnect.apple.com/v1/ciBuildRuns/9461d71a-0fb3-43ed-9b7a-e154fed69742/actions"
        }
      }
    },
    "links" : {
      "self" : "https://api.appstoreconnect.apple.com/v1/ciBuildRuns/9461d71a-0fb3-43ed-9b7a-e154fed69742"
    }
  },
  "links" : {
    "self" : "https://api.appstoreconnect.apple.com/v1/ciBuildRuns"
  }
}
Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [StringCodingKey(stringValue: "data", intValue: nil), StringCodingKey(stringValue: "attributes", intValue: nil), StringCodingKey(stringValue: "sourceCommit", intValue: nil), StringCodingKey(stringValue: "author", intValue: nil), StringCodingKey(stringValue: "avatarUrl", intValue: nil)], debugDescription: "Invalid URL string.", underlyingError: nil)).
github-actions[bot] commented 10 months ago

This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.