From c8a2ea21bd716fa65da67473e48b922df453807f Mon Sep 17 00:00:00 2001 From: alexchornyi <85160203+alexchornyi@users.noreply.github.com> Date: Wed, 30 Jun 2021 20:21:07 +0300 Subject: [PATCH] The encoding and decoding of a Rule is not consistent, i.e. not all fields are encoded, e.g.: (#14) logic is decoded but not encoded in encode countryCode is decoded not encoded in encode affectedString is encoded twice Co-authored-by: Alexandr Chernyy --- Sources/CertLogic/Rule.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/CertLogic/Rule.swift b/Sources/CertLogic/Rule.swift index 407ace4..358cbbf 100644 --- a/Sources/CertLogic/Rule.swift +++ b/Sources/CertLogic/Rule.swift @@ -181,7 +181,8 @@ public class Rule: Codable { try container.encode(validFrom, forKey: .validFrom) try container.encode(validTo, forKey: .validTo) try container.encode(affectedString, forKey: .affectedString) - try container.encode(affectedString, forKey: .affectedString) + try container.encode(logic, forKey: .logic) + try container.encode(countryCode, forKey: .countryCode) } }