You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a milk packaging with barcode 025293001220 on it.
The barcode is invalid, because it lacks the leading 0. If we add it the barcode becomes valid - 0025293001220.
I can't come up with workarounds for the problem since the requester can't know how many leading zeroes to append to the barcode - while 025293001220 is invalid, both 0025293001220 and 00025293001220 are valid (2 and 3 leading zeroes).
Describe the bug
There's a milk packaging with barcode
025293001220
on it.The barcode is invalid, because it lacks the leading
0
. If we add it the barcode becomes valid -0025293001220
.The
product
endpoint is aware of it and when the invalid barcode is requested it automatically adds the leading zero, making the product found: https://ru.openfoodfacts.org/api/v0/product/025293001220.jsonBut the
products
(multiple barcodes) endpoint seems to be not aware of it and it gives an empty list when the invalid barcode is requested: https://world.openfoodfacts.org/products/025293001220.jsonI can't come up with workarounds for the problem since the requester can't know how many leading zeroes to append to the barcode - while
025293001220
is invalid, both0025293001220
and00025293001220
are valid (2 and 3 leading zeroes).To Reproduce
Request https://ru.openfoodfacts.org/api/v0/product/025293001220.json
Then https://world.openfoodfacts.org/products/025293001220.json
Expected behavior
products
is expected to validate barcodes in the same way asproduct
.Screenshots
No response
Additional context
No response
Type of device
REST-API
Browser version
No response
Number of products impacted
No response
Time per product
No response
The text was updated successfully, but these errors were encountered: