openfoodfacts-server icon indicating copy to clipboard operation
openfoodfacts-server copied to clipboard

Create an API route to provide Quality Warnings and Errors on a given nutrition table/ingredients list

Open teolemon opened this issue 1 year ago • 3 comments

What

  • Create an API route to provide Quality Warnings and Errors on a given nutrition table (not related to a product)

  • Create an API route to provide Quality Warnings and Errors on a given ingredient list (not related to a product)

  • That would help on product addition/edition in the app to spot and warn users in real time with potential errors and warnings in real time

  • https://world.openfoodfacts.org/data-quality-error/nutrition-values-are-all-identical

  • https://world.openfoodfacts.org/data-quality-error/nutrition-errors

Even for new products, we could send values to a To be created™ route, that could send back potential errors and warnings in real time

Part of

  • #5538

Originally posted by @teolemon in https://github.com/openfoodfacts/smooth-app/issues/3978#issuecomment-1914093869

teolemon avatar Jan 29 '24 07:01 teolemon

Can I work on this?

IsaiahLevy avatar Apr 04 '24 23:04 IsaiahLevy

@IsaiahLevy Sure!

Some comments about this issue:

We are building a "product services" API that allows to run specific services (such as analyzing the ingredient list) on product data that is provided as input to the API. There is a test file to demonstrate some of that: https://github.com/openfoodfacts/openfoodfacts-server/blob/main/tests/integration/api_v3_product_services.t

So for this issue, the best solution would be to create a "check_quality" service that would run the quality checks from lib/ProductOpener/DataQuality.pm and send back the related data_quality_*_tags fields.

The code for the existing product services is in https://github.com/openfoodfacts/openfoodfacts-server/blob/main/lib/ProductOpener/APIProductServices.pm

stephanegigandet avatar Apr 05 '24 07:04 stephanegigandet

I'm bumping this one to P1, as it would be useful to many apps (ours, Macrofactor; Foodvisor…)

teolemon avatar May 11 '24 19:05 teolemon