openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
656 stars 386 forks source link

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

Open teolemon opened 9 months ago

teolemon commented 9 months ago

What

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

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

IsaiahLevy commented 7 months ago

Can I work on this?

stephanegigandet commented 7 months ago

@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 dataquality*_tags fields.

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

teolemon commented 6 months ago

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