Skip to content

Commit

Permalink
Merge pull request #64 from veracode/optional-paths
Browse files Browse the repository at this point in the history
PIF workspace and project paths may not be present
  • Loading branch information
bmxav authored Aug 20, 2024
2 parents e50e90b + df49584 commit 8fbfe2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PIF/Sources/PIFSupport/PIF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public enum PIF {
public final class Workspace: Decodable {
public let guid: GUID
public let name: String
public let path: URL
public let path: URL?
public let projects: [Project]

private enum CodingKeys: CodingKey {
Expand All @@ -94,7 +94,7 @@ public enum PIF {

guid = try container.decode(GUID.self, forKey: .guid)
name = try container.decode(String.self, forKey: .name)
path = try container.decode(URL.self, forKey: .path)
path = try container.decodeIfPresent(URL.self, forKey: .path)

let projectPaths = try container.decode([String].self, forKey: .projects)
.map {
Expand Down Expand Up @@ -124,7 +124,7 @@ public enum PIF {
public final class Project: Decodable {
public let guid: GUID
public let projectName: String?
public let path: URL
public let path: URL?
public let projectDirectory: URL
public let developmentRegion: String?
public let buildConfigurations: [BuildConfiguration]
Expand All @@ -143,7 +143,7 @@ public enum PIF {

guid = try container.decode(GUID.self, forKey: .guid)
projectName = try container.decodeIfPresent(String.self, forKey: .projectName)
path = try container.decode(URL.self, forKey: .path)
path = try container.decodeIfPresent(URL.self, forKey: .path)
projectDirectory = try container.decode(URL.self, forKey: .projectDirectory)
developmentRegion = try container.decodeIfPresent(String.self, forKey: .developmentRegion)
buildConfigurations = try container.decode([BuildConfiguration].self, forKey: .buildConfigurations)
Expand Down

0 comments on commit 8fbfe2b

Please sign in to comment.