Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Local Pods/GitHubAPI/GitHubAPI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
29F8BAC0204B577800E5CA32 /* V3NotificationSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F8BABF204B577800E5CA32 /* V3NotificationSubject.swift */; };
29F8BAC2204B57EC00E5CA32 /* V3Notification.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F8BAC1204B57EC00E5CA32 /* V3Notification.swift */; };
4906A18D206ADECE0031F6F5 /* invitation_notification.json in Resources */ = {isa = PBXBuildFile; fileRef = 4906A18C206ADECE0031F6F5 /* invitation_notification.json */; };
492557C8210BBB45009CF825 /* no_milestone_description.json in Resources */ = {isa = PBXBuildFile; fileRef = 492557C7210BBB45009CF825 /* no_milestone_description.json */; };
496C9CE620965F2800F13F09 /* security_vulnerability.json in Resources */ = {isa = PBXBuildFile; fileRef = 496C9CE520965F2800F13F09 /* security_vulnerability.json */; };
985AD904C6ABF3E0A1F46079 /* Pods_GitHubAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AAB687054FAA1CE0478BE468 /* Pods_GitHubAPI.framework */; };
D4D67C0931ACEE218D81A041 /* Pods_GitHubAPITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD96096F323FEE96EB3F8D0D /* Pods_GitHubAPITests.framework */; };
Expand Down Expand Up @@ -138,6 +139,7 @@
29F8BAC1204B57EC00E5CA32 /* V3Notification.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = V3Notification.swift; sourceTree = "<group>"; };
33E0718D024CC4F81EBF7364 /* Pods-GitHubAPITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GitHubAPITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-GitHubAPITests/Pods-GitHubAPITests.release.xcconfig"; sourceTree = "<group>"; };
4906A18C206ADECE0031F6F5 /* invitation_notification.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = invitation_notification.json; sourceTree = "<group>"; };
492557C7210BBB45009CF825 /* no_milestone_description.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = no_milestone_description.json; sourceTree = "<group>"; };
496C9CE520965F2800F13F09 /* security_vulnerability.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = security_vulnerability.json; sourceTree = "<group>"; };
8FAA1C36CB3C11579EF5BE54 /* Pods-GitHubAPI.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GitHubAPI.release.xcconfig"; path = "Pods/Target Support Files/Pods-GitHubAPI/Pods-GitHubAPI.release.xcconfig"; sourceTree = "<group>"; };
AAB687054FAA1CE0478BE468 /* Pods_GitHubAPI.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GitHubAPI.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -253,6 +255,7 @@
2958050A204B5A68009CFD51 /* notifications.json */,
4906A18C206ADECE0031F6F5 /* invitation_notification.json */,
496C9CE520965F2800F13F09 /* security_vulnerability.json */,
492557C7210BBB45009CF825 /* no_milestone_description.json */,
);
path = GitHubAPITests;
sourceTree = "<group>";
Expand Down Expand Up @@ -383,6 +386,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
492557C8210BBB45009CF825 /* no_milestone_description.json in Resources */,
496C9CE620965F2800F13F09 /* security_vulnerability.json in Resources */,
2958050B204B5A68009CFD51 /* notifications.json in Resources */,
4906A18D206ADECE0031F6F5 /* invitation_notification.json in Resources */,
Expand Down
2 changes: 1 addition & 1 deletion Local Pods/GitHubAPI/GitHubAPI/V3Milestone.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct V3Milestone: Codable {
public let createdAt: Date
public let closedIssues: Int
public let closedAt: Date?
public let description: String
public let description: String?
public let dueOn: Date?
public let id: Int
public let number: Int
Expand Down
17 changes: 17 additions & 0 deletions Local Pods/GitHubAPI/GitHubAPITests/GitHubAPITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,22 @@ class GitHubAPITests: XCTestCase {
XCTAssertEqual(first.subject.title, "Potential security vulnerability found in the hoek dependency")
}
}

func test_milestoneWithoutDescriptionsJSON() {
let data = try! Data(contentsOf: Bundle(for: type(of: self)).url(forResource: "no_milestone_description", withExtension: "json")!)
let result = processResponse(request: V3MilestoneRequest(owner: "nurpax", repo: "petmate"), input: data)
switch result {
case .failure(let error): XCTFail(error?.localizedDescription ?? "Failed without error")
case .success(let response):
XCTAssertEqual(response.data.count, 2)

let first = response.data.first!
XCTAssertEqual(first.id, 3514116)
XCTAssertEqual(first.closedIssues, 6)
XCTAssertEqual(first.openIssues, 6)
XCTAssertNil(first.description)
XCTAssertNil(first.closedAt)
}
}

}
76 changes: 76 additions & 0 deletions Local Pods/GitHubAPI/GitHubAPITests/no_milestone_description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[
{
"id" : 3514116,
"description" : null,
"open_issues" : 6,
"state" : "open",
"created_at" : "2018-07-22T13:29:11Z",
"labels_url" : "https://api.github.com/repos/nurpax/petmate/milestones/1/labels",
"url" : "https://api.github.com/repos/nurpax/petmate/milestones/1",
"node_id" : "MDk6TWlsZXN0b25lMzUxNDExNg==",
"closed_issues" : 6,
"title" : "0.1",
"creator" : {
"id" : 297823,
"organizations_url" : "https://api.github.com/users/nurpax/orgs",
"received_events_url" : "https://api.github.com/users/nurpax/received_events",
"following_url" : "https://api.github.com/users/nurpax/following{/other_user}",
"login" : "nurpax",
"avatar_url" : "https://avatars0.githubusercontent.com/u/297823?v=4",
"url" : "https://api.github.com/users/nurpax",
"node_id" : "MDQ6VXNlcjI5NzgyMw==",
"subscriptions_url" : "https://api.github.com/users/nurpax/subscriptions",
"repos_url" : "https://api.github.com/users/nurpax/repos",
"type" : "User",
"html_url" : "https://github.com/nurpax",
"events_url" : "https://api.github.com/users/nurpax/events{/privacy}",
"site_admin" : false,
"starred_url" : "https://api.github.com/users/nurpax/starred{/owner}{/repo}",
"gists_url" : "https://api.github.com/users/nurpax/gists{/gist_id}",
"gravatar_id" : "",
"followers_url" : "https://api.github.com/users/nurpax/followers"
},
"html_url" : "https://github.com/nurpax/petmate/milestone/1",
"number" : 1,
"updated_at" : "2018-07-26T22:35:52Z",
"due_on" : null,
"closed_at" : null
},
{
"id" : 3514117,
"description" : null,
"open_issues" : 4,
"state" : "open",
"created_at" : "2018-07-22T13:30:01Z",
"labels_url" : "https://api.github.com/repos/nurpax/petmate/milestones/2/labels",
"url" : "https://api.github.com/repos/nurpax/petmate/milestones/2",
"node_id" : "MDk6TWlsZXN0b25lMzUxNDExNw==",
"closed_issues" : 0,
"title" : "0.2",
"creator" : {
"id" : 297823,
"organizations_url" : "https://api.github.com/users/nurpax/orgs",
"received_events_url" : "https://api.github.com/users/nurpax/received_events",
"following_url" : "https://api.github.com/users/nurpax/following{/other_user}",
"login" : "nurpax",
"avatar_url" : "https://avatars0.githubusercontent.com/u/297823?v=4",
"url" : "https://api.github.com/users/nurpax",
"node_id" : "MDQ6VXNlcjI5NzgyMw==",
"subscriptions_url" : "https://api.github.com/users/nurpax/subscriptions",
"repos_url" : "https://api.github.com/users/nurpax/repos",
"type" : "User",
"html_url" : "https://github.com/nurpax",
"events_url" : "https://api.github.com/users/nurpax/events{/privacy}",
"site_admin" : false,
"starred_url" : "https://api.github.com/users/nurpax/starred{/owner}{/repo}",
"gists_url" : "https://api.github.com/users/nurpax/gists{/gist_id}",
"gravatar_id" : "",
"followers_url" : "https://api.github.com/users/nurpax/followers"
},
"html_url" : "https://github.com/nurpax/petmate/milestone/2",
"number" : 2,
"updated_at" : "2018-07-26T20:51:18Z",
"due_on" : null,
"closed_at" : null
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>