Open aleene opened 7 years ago
In fact it is more subtle. Products that are serving based, have _serving-fields as strings, but calculated _100g fields as strings as well:
"fiber_serving":"0","sugars":"10","fat":"7","salt_100g":"2.05"
The _serving and the _100g values are sometimes calculated and sometimes not. Make this clear by creating a specific key postfix, i.e. _serving_calculated and 100g_calculated. These fields can then also be numbers.
The values of the nutriments in the json-api are inconsistent.
"saturated-fat_serving":0.26,"proteins_serving":7.67,"sugars_value":"1.7","energy_100g":"1546"
It should be made consistent. I guess it should be string, as it would allow the user to enter strings (such as "traces").