openfoodfacts/openfoodfacts-server

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

teolemon opened this issue · 3 comments

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 openfoodfacts/smooth-app#3978 (comment)

Can I work on this?

@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

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