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
660 stars 389 forks source link

serving_quantity_unit is not returned if there is a space in Serving Size between the size and the unit. #11015

Open theedov opened 1 week ago

theedov commented 1 week ago

What

If someone updates the product serving size to contain a space between the size and the unit, it makes the API not return the serving_quantity_unit. For example, if I enter "5 gā€, there will be no serving_quantity_unit returned from the API, but if I enter "5gā€, everything is ok, and serving_quantity_unit is there.

Steps to reproduce the behavior

On the web, try to edit "Serving Size" of any product to contain space between the size and the unit.

Expected behavior

The response should have serving_quantity_unit returned in both scenarios(or maybe consider not allowing spaces).

Type of device

REST-API