Skip to content

Commit 5caabcf

Browse files
authored
fix: Swift.DecodingError.keyNotFound when decoding Traits (#71)
1 parent fcf746e commit 5caabcf

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

FlagsmithClient/Classes/Identity.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ public struct Identity: Decodable, Sendable {
2020

2121
public let flags: [Flag]
2222
public let traits: [Trait]
23-
public let transient: Bool
23+
public let transient: Bool?
2424
}

FlagsmithClient/Classes/Trait.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public struct Trait: Codable, Sendable {
2626
/// - note: In the future, this can be renamed back to 'value' as major/feature-breaking
2727
/// updates are released.
2828
public var typedValue: TypedValue
29-
public let transient: Bool
29+
public let transient: Bool?
3030
/// The identity of the `Trait` when creating.
3131
internal let identifier: String?
3232

FlagsmithClient/Classes/Traits.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public struct Traits: Codable, Sendable {
1414
public let traits: [Trait]
1515
public let identifier: String?
1616
public let flags: [Flag]
17-
public let transient: Bool
17+
public let transient: Bool?
1818

1919
init(traits: [Trait], identifier: String?, flags: [Flag] = [], transient: Bool = false) {
2020
self.traits = traits
@@ -30,3 +30,4 @@ public struct Traits: Codable, Sendable {
3030
try container.encode(transient, forKey: .transient)
3131
}
3232
}
33+

0 commit comments

Comments
 (0)