Skip to content

Commit

Permalink
Use correct key 'profiles' for BundleId relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
MortenGregersen committed Sep 3, 2020
1 parent 1a9997a commit 31387c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Models/BundleIdRelationship.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@
import Foundation

public enum BundleIdRelationship: Codable {
case profile(Profile)
case profiles(Profile)
case bundleIdCapability(BundleIdCapability)

enum TypeKeys: String, CodingKey {
case type
}
enum CodingKeys: String, Decodable, CodingKey {
case profile, bundleIdCapability
case profiles, bundleIdCapability
}

public init(from decoder: Decoder) throws {
let type = try decoder.container(keyedBy: TypeKeys.self).decode(CodingKeys.self, forKey: .type)
switch type {
case .profile:
self = try .profile(Profile(from: decoder))
case .profiles:
self = try .profiles(Profile(from: decoder))
case .bundleIdCapability:
self = try .bundleIdCapability(BundleIdCapability(from: decoder))
}
}

public func encode(to encoder: Encoder) throws {
switch self {
case .profile(let value):
case .profiles(let value):
try value.encode(to: encoder)
case .bundleIdCapability(let value):
try value.encode(to: encoder)
Expand Down

0 comments on commit 31387c7

Please sign in to comment.