diff --git a/robotoff/app/schema.py b/robotoff/app/schema.py index b5c6cdebab..7f39433075 100644 --- a/robotoff/app/schema.py +++ b/robotoff/app/schema.py @@ -89,15 +89,15 @@ "nutriments": { "type": "object", "properties": { - "fat": {"type": "number"}, - "saturated_fat": {"type": "number"}, - "carbohydrates": {"type": "number"}, - "sugars": {"type": "number"}, - "fiber": {"type": "number"}, - "proteins": {"type": "number"}, - "salt": {"type": "number"}, - "energy_kcal": {"type": "number"}, - "fruits_vegetables_nuts": {"type": "number"}, + "fat_100g": {"type": "number"}, + "saturated-fat_100g": {"type": "number"}, + "carbohydrates_100g": {"type": "number"}, + "sugars_100g": {"type": "number"}, + "fiber_100g": {"type": "number"}, + "proteins_100g": {"type": "number"}, + "salt_100g": {"type": "number"}, + "energy-kcal_100g": {"type": "number"}, + "fruits-vegetables-nuts_100g": {"type": "number"}, }, "additionalProperties": False, }, diff --git a/robotoff/off.py b/robotoff/off.py index e244b2b616..be85a23541 100644 --- a/robotoff/off.py +++ b/robotoff/off.py @@ -115,7 +115,9 @@ def get_product_image_select_url(server: Union[ServerType, str]) -> str: def get_api_product_url(server: Union[ServerType, str]) -> str: - return "{}/api/v0/product".format(get_base_url(server)) + # V2 of API is required to have proper ingredient nesting + # for product categorization + return "{}/api/v2/product".format(get_base_url(server)) def get_base_url(server: Union[ServerType, str]) -> str: