From 04d0d47320f08d2ed5118f3b05305d35f532ac81 Mon Sep 17 00:00:00 2001 From: cdricms <36056008+cdricms@users.noreply.github.com> Date: Wed, 24 Jan 2024 23:27:12 +0100 Subject: [PATCH] Added nutriscoreGrade --- Sources/OpenFoodFacts/types/Product.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/OpenFoodFacts/types/Product.swift b/Sources/OpenFoodFacts/types/Product.swift index 99a713f..4b6af52 100644 --- a/Sources/OpenFoodFacts/types/Product.swift +++ b/Sources/OpenFoodFacts/types/Product.swift @@ -131,6 +131,7 @@ public class Product: Codable, ObjectDebugger { public var netWeightValue: String? public var nutritionDataPer: String? public var nutritionScoreWarningNoFruitsVegetablesNuts: Float? + public var nutriscoreGrade: String? public var noNutritionData: String? public var novaGroup: Float? public var novaGroups: String? @@ -330,6 +331,7 @@ public class Product: Codable, ObjectDebugger { case netWeightValue = "net_weight_value" case nutritionDataPer = "nutrition_data_per" case nutritionScoreWarningNoFruitsVegetablesNuts = "nutrition_score_warning_no_fruits_vegetables_nuts" + case nutriscoreGrade = "nutriscore_grade" case noNutritionData = "no_nutrition_data" case novaGroup = "nova_group" case novaGroups = "nova_groups" @@ -599,6 +601,7 @@ public class Product: Codable, ObjectDebugger { nucleotidesTags = try container.decodeIfPresent([String].self, forKey: .nucleotidesTags) nutrientLevelsTags = try container.decodeIfPresent([String].self, forKey: .nutrientLevelsTags) nutritionData = try container.decodeIfPresent(String.self, forKey: .nutritionData) + nutriscoreGrade = try container.decodeIfPresent(String.self, forKey: .nutriscoreGrade) nutritionDataPerDebugTags = try container.decodeIfPresent([String].self, forKey: .nutritionDataPerDebugTags) nutritionDataPrepared = try container.decodeIfPresent(String.self, forKey: .nutritionDataPrepared) nutritionDataPreparedPer = try container.decodeIfPresent(String.self, forKey: .nutritionDataPreparedPer)