Serving quantity unit

This commit is contained in:
cdricms
2025-09-13 18:59:04 +02:00
parent 7f77d777b4
commit 8647301ae2

View File

@@ -176,6 +176,7 @@ public class Product: Codable, ObjectDebugger {
public var recyclingInstructionsToDiscard: String? public var recyclingInstructionsToDiscard: String?
public var rev: Float? public var rev: Float?
public var servingQuantity: String? public var servingQuantity: String?
public var servingQuantityUnit: String?
public var servingSize: String? public var servingSize: String?
public var servingSizeDebugTags: [String]? public var servingSizeDebugTags: [String]?
public var sortkey: Float? public var sortkey: Float?
@@ -385,6 +386,7 @@ public class Product: Codable, ObjectDebugger {
"recycling_instructions_to_discard" "recycling_instructions_to_discard"
case rev case rev
case servingQuantity = "serving_quantity" case servingQuantity = "serving_quantity"
case servingQuantityUnit = "serving_quantity_unit"
case servingSize = "serving_size" case servingSize = "serving_size"
case servingSizeDebugTags = "serving_size_debug_tags" case servingSizeDebugTags = "serving_size_debug_tags"
case sortkey case sortkey
@@ -838,6 +840,10 @@ public class Product: Codable, ObjectDebugger {
} else { } else {
servingQuantity = nil servingQuantity = nil
} }
servingQuantityUnit = try container.decodeIfPresent(
String.self,
forKey:
.servingQuantityUnit)
servingSize = try container.decodeIfPresent( servingSize = try container.decodeIfPresent(
String.self, forKey: .servingSize) String.self, forKey: .servingSize)
servingSizeDebugTags = try container.decodeIfPresent( servingSizeDebugTags = try container.decodeIfPresent(