Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the new nutrient order and list API for edit mode #210

Closed
Tracked by #218
teolemon opened this issue Jul 30, 2021 · 6 comments
Closed
Tracked by #218

Add the new nutrient order and list API for edit mode #210

teolemon opened this issue Jul 30, 2021 · 6 comments

Comments

@teolemon
Copy link
Member

teolemon commented Jul 30, 2021

What

Nutrient order and list changes based on country:
https://fr.openfoodfacts.org/cgi/nutrients.pl
https://us.openfoodfacts.org/cgi/nutrients.pl
https://us-es.openfoodfacts.org/cgi/nutrients.pl

I had forgotten about this nice API for the edit mode (and potentially for view mode for the nutrition table)

Part of

  • Nutrition editing

Code sample

{
  "nutrients": [
    {
      "display_in_edit_form": true,
      "important": true,
      "id": "energy-kj",
      "name": "Énergie (kJ)"
    },
    {
      "name": "Énergie (kcal)",
      "id": "energy-kcal",
      "important": true,
      "display_in_edit_form": true
    },
    {
      "important": false,
      "id": "energy",
      "name": "Énergie",
      "display_in_edit_form": false,
      "nutrients": [
        {
          "display_in_edit_form": false,
          "name": "Énergie provenant des graisses",
          "important": false,
          "id": "energy-from-fat"
        }
      ]
    },
    {
      "name": "Matières grasses / Lipides",
      "id": "fat",
      "important": true,
      "display_in_edit_form": true,
      "nutrients": [
        {
          "nutrients": [
            {
              "name": "Acide butyrique (4:0)",
              "id": "butyric-acid",
              "important": false,
              "display_in_edit_form": false,
              "nutrients": [
                {
                  "name": "Acide caproïque (6:0)",
                  "important": false,
                  "id": "caproic-acid",
                  "display_in_edit_form": false
                },
                {
                  "id": "caprylic-acid",
                  "important": false,
                  "name": "Acide caproïque (8:0)",
                  "display_in_edit_form": false
                },
                {
                  "name": "Acide caprique (10:0)",
                  "important": false,
                  "id": "capric-acid",
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "important": false,
                  "id": "lauric-acid",
                  "name": "Acide laurique (12:0)"
                },
                {
                  "name": "Acide myristique (14:0)",
                  "important": false,
                  "id": "myristic-acid",
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "name": "Acide palmitique (16:0)",
                  "important": false,
                  "id": "palmitic-acid"
                },
                {
                  "name": "Acide stéarique (18:0)",
                  "important": false,
                  "id": "stearic-acid",
                  "display_in_edit_form": false
                },
                {
                  "id": "arachidic-acid",
                  "important": false,
                  "name": "Acide arachidique / acide eicosanoïque (20:0)",
                  "display_in_edit_form": false
                },
                {
                  "name": "Acide béhénique (22:0)",
                  "id": "behenic-acid",
                  "important": false,
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "name": "Acide lignocérique (24:0)",
                  "important": false,
                  "id": "lignoceric-acid"
                },
                {
                  "important": false,
                  "id": "cerotic-acid",
                  "name": "Acide cérotique (26:0)",
                  "display_in_edit_form": false
                },
                {
                  "id": "montanic-acid",
                  "important": false,
                  "name": "Acide montanique (28:0)",
                  "display_in_edit_form": false
                },
                {
                  "id": "melissic-acid",
                  "important": false,
                  "name": "Acide mélissique (30:0)",
                  "display_in_edit_form": false
                },
                {
                  "name": "Acides gras monoinsaturés",
                  "id": "monounsaturated-fat",
                  "important": false,
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "name": "Acides gras polyinsaturés",
                  "id": "polyunsaturated-fat",
                  "important": false
                },
                {
                  "display_in_edit_form": false,
                  "id": "omega-3-fat",
                  "important": false,
                  "name": "Acides gras Oméga 3"
                },
                {
                  "display_in_edit_form": false,
                  "important": false,
                  "id": "alpha-linolenic-acid",
                  "name": "Acide alpha-linolénique / ALA (18:3 n-3)"
                },
                {
                  "important": false,
                  "id": "eicosapentaenoic-acid",
                  "name": "Acide eicosapentaénoïque / EPA (20:5 n-3)",
                  "display_in_edit_form": false
                },
                {
                  "name": "Acide docosahexaénoïque / DHA (22:6 n-3)",
                  "important": false,
                  "id": "docosahexaenoic-acid",
                  "display_in_edit_form": false
                },
                {
                  "important": false,
                  "id": "omega-6-fat",
                  "name": "Acides gras Oméga 6",
                  "display_in_edit_form": false
                },
                {
                  "id": "linoleic-acid",
                  "important": false,
                  "name": "Acide linoléique / LA (18:2 n-6)",
                  "display_in_edit_form": false
                },
                {
                  "name": "Acide arachidonique / AA / ARA (20:4 n-6)",
                  "id": "arachidonic-acid",
                  "important": false,
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "name": "Acide gamma-linolénique / GLA (18:3 n-6)",
                  "important": false,
                  "id": "gamma-linolenic-acid"
                },
                {
                  "display_in_edit_form": false,
                  "name": "Acide dihomo-gamma-linolénique / DGLA (20:3 n-6)",
                  "important": false,
                  "id": "dihomo-gamma-linolenic-acid"
                },
                {
                  "important": false,
                  "id": "omega-9-fat",
                  "name": "Acides gras Oméga 9",
                  "display_in_edit_form": false
                },
                {
                  "name": "Acide oléique (18:1 n-9)",
                  "important": false,
                  "id": "oleic-acid",
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "important": false,
                  "id": "elaidic-acid",
                  "name": "Acide élaïdique (18:1 n-9)"
                },
                {
                  "display_in_edit_form": false,
                  "id": "gondoic-acid",
                  "important": false,
                  "name": "Acide gadoléique (20:1 n-9)"
                },
                {
                  "important": false,
                  "id": "mead-acid",
                  "name": "Acide de Mead (20:3 n-9)",
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "name": "Acide érucique (22:1 n-9)",
                  "id": "erucic-acid",
                  "important": false
                },
                {
                  "display_in_edit_form": false,
                  "name": "Acide nervonique (24:1 n-9)",
                  "id": "nervonic-acid",
                  "important": false
                },
                {
                  "name": "Acides gras trans",
                  "important": false,
                  "id": "trans-fat",
                  "display_in_edit_form": false
                },
                {
                  "name": "Cholestérol",
                  "important": false,
                  "id": "cholesterol",
                  "display_in_edit_form": false
                }
              ]
            }
          ],
          "display_in_edit_form": true,
          "name": "Acides gras saturés",
          "id": "saturated-fat",
          "important": false
        }
      ]
    },
    {
      "display_in_edit_form": true,
      "nutrients": [
        {
          "important": false,
          "id": "sugars",
          "name": "Sucres",
          "nutrients": [
            {
              "name": "Saccharose",
              "important": false,
              "id": "sucrose",
              "nutrients": [
                {
                  "name": "Glucose",
                  "important": false,
                  "id": "glucose",
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "important": false,
                  "id": "fructose",
                  "name": "Fructose"
                },
                {
                  "id": "lactose",
                  "important": false,
                  "name": "Lactose",
                  "display_in_edit_form": false
                },
                {
                  "name": "Maltose",
                  "id": "maltose",
                  "important": false,
                  "display_in_edit_form": false
                },
                {
                  "display_in_edit_form": false,
                  "id": "maltodextrins",
                  "important": false,
                  "name": "Maltodextrines"
                },
                {
                  "display_in_edit_form": false,
                  "name": "Amidon",
                  "id": "starch",
                  "important": false
                },
                {
                  "display_in_edit_form": false,
                  "name": "Polyols",
                  "id": "polyols",
                  "important": false
                },
                {
                  "display_in_edit_form": true,
                  "name": "Fibres alimentaires",
                  "important": false,
                  "id": "fiber"
                },
                {
                  "display_in_edit_form": false,
                  "name": "Fibres solubles",
                  "id": "soluble-fiber",
                  "important": false
                },
                {
                  "id": "insoluble-fiber",
                  "important": false,
                  "name": "Fibres insolubles",
                  "display_in_edit_form": false
                }
              ],
              "display_in_edit_form": false
            }
          ],
          "display_in_edit_form": true
        }
      ],
      "name": "Glucides",
      "important": true,
      "id": "carbohydrates"
    },
    {
      "nutrients": [
        {
          "name": "Caséine",
          "important": false,
          "id": "casein",
          "nutrients": [
            {
              "display_in_edit_form": false,
              "id": "serum-proteins",
              "important": false,
              "name": "Protéines sériques"
            },
            {
              "id": "nucleotides",
              "important": false,
              "name": "Nucléotides",
              "display_in_edit_form": false
            },
            {
              "important": false,
              "id": "salt",
              "name": "Sel",
              "display_in_edit_form": true
            },
            {
              "display_in_edit_form": true,
              "name": "Sodium",
              "important": false,
              "id": "sodium"
            },
            {
              "display_in_edit_form": true,
              "id": "alcohol",
              "important": false,
              "name": "Alcool"
            }
          ],
          "display_in_edit_form": false
        }
      ],
      "display_in_edit_form": true,
      "important": true,
      "id": "proteins",
      "name": "Protéines"
    },
    {
      "name": "Vitamine A (rétinol)",
      "id": "vitamin-a",
      "important": false,
      "display_in_edit_form": false
    },
    {
      "id": "beta-carotene",
      "important": false,
      "name": "Bêta carotène",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "name": "Vitamine D / D3 (cholécalciférol)",
      "id": "vitamin-d",
      "important": false
    },
    {
      "display_in_edit_form": false,
      "name": "Vitamine E (tocophérol)",
      "id": "vitamin-e",
      "important": false
    },
    {
      "display_in_edit_form": false,
      "name": "Vitamine K",
      "important": false,
      "id": "vitamin-k"
    },
    {
      "display_in_edit_form": false,
      "name": "Vitamine C (acide ascorbique)",
      "important": false,
      "id": "vitamin-c"
    },
    {
      "name": "Vitamine B1 (Thiamine)",
      "id": "vitamin-b1",
      "important": false,
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "id": "vitamin-b2",
      "important": false,
      "name": "Vitamine B2 (Riboflavine)"
    },
    {
      "name": "Vitamine B3 / Vitamine PP (Niacine)",
      "important": false,
      "id": "vitamin-pp",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "important": false,
      "id": "vitamin-b6",
      "name": "Vitamine B6 (Pyridoxine)"
    },
    {
      "important": false,
      "id": "vitamin-b9",
      "name": "Vitamine B9 (Acide folique)",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "important": false,
      "id": "folates",
      "name": "Folates (folates totaux)"
    },
    {
      "name": "Vitamine B12 (cobalamine)",
      "important": false,
      "id": "vitamin-b12",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "id": "biotin",
      "important": false,
      "name": "Biotine (Vitamine B8 / B7 / H)"
    },
    {
      "name": "Acide pantothénique (Vitamine B5)",
      "id": "pantothenic-acid",
      "important": false,
      "display_in_edit_form": false
    },
    {
      "name": "Silice",
      "important": false,
      "id": "silica",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "name": "Bicarbonate",
      "important": false,
      "id": "bicarbonate"
    },
    {
      "id": "potassium",
      "important": false,
      "name": "Potassium",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "name": "Chlorure",
      "id": "chloride",
      "important": false
    },
    {
      "name": "Calcium",
      "id": "calcium",
      "important": false,
      "display_in_edit_form": false
    },
    {
      "name": "Phosphore",
      "id": "phosphorus",
      "important": false,
      "display_in_edit_form": false
    },
    {
      "id": "iron",
      "important": false,
      "name": "Fer",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "important": false,
      "id": "magnesium",
      "name": "Magnésium"
    },
    {
      "display_in_edit_form": false,
      "name": "Zinc",
      "important": false,
      "id": "zinc"
    },
    {
      "display_in_edit_form": false,
      "important": false,
      "id": "copper",
      "name": "Cuivre"
    },
    {
      "important": false,
      "id": "manganese",
      "name": "Manganèse",
      "display_in_edit_form": false
    },
    {
      "name": "Fluorure",
      "id": "fluoride",
      "important": false,
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "name": "Sélénium",
      "id": "selenium",
      "important": false
    },
    {
      "display_in_edit_form": false,
      "name": "Chrome",
      "important": false,
      "id": "chromium"
    },
    {
      "display_in_edit_form": false,
      "important": false,
      "id": "molybdenum",
      "name": "Molybdène"
    },
    {
      "display_in_edit_form": false,
      "name": "Iode",
      "important": false,
      "id": "iodine"
    },
    {
      "display_in_edit_form": false,
      "important": false,
      "id": "caffeine",
      "name": "Caféine / Théine"
    },
    {
      "display_in_edit_form": false,
      "name": "Taurine",
      "important": false,
      "id": "taurine"
    },
    {
      "display_in_edit_form": false,
      "id": "ph",
      "important": false
    },
    {
      "display_in_edit_form": false,
      "name": "Fruits, légumes, noix et huiles de colza, noix et olive",
      "important": false,
      "id": "fruits-vegetables-nuts"
    },
    {
      "name": "Fruits, légumes et noix - séchés",
      "id": "fruits-vegetables-nuts-dried",
      "important": false,
      "display_in_edit_form": false
    },
    {
      "id": "fruits-vegetables-nuts-estimate",
      "important": false,
      "name": "Fruits, légumes, noix et huiles de colza, noix et olive (estimation manuelle avec la liste des ingrédients)",
      "display_in_edit_form": false
    },
    {
      "important": false,
      "id": "collagen-meat-protein-ratio",
      "name": "Rapport collagène sur protéines de viande (maximum)",
      "display_in_edit_form": false
    },
    {
      "important": false,
      "id": "cocoa",
      "name": "Cacao (minimum)",
      "display_in_edit_form": false
    },
    {
      "important": false,
      "id": "chlorophyl",
      "display_in_edit_form": false
    },
    {
      "important": false,
      "id": "carbon-footprint",
      "name": "Empreinte carbone / émissions de CO2",
      "display_in_edit_form": true
    },
    {
      "id": "carbon-footprint-from-meat-or-fish",
      "important": false,
      "name": "Empreinte carbone de la viande ou du poisson",
      "display_in_edit_form": false
    },
    {
      "important": false,
      "id": "nutrition-score-fr",
      "name": "Score nutritionnel - France",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "important": false,
      "id": "nutrition-score-uk"
    },
    {
      "display_in_edit_form": false,
      "important": false,
      "id": "glycemic-index"
    },
    {
      "name": "Dureté de l'eau",
      "important": false,
      "id": "water-hardness",
      "display_in_edit_form": false
    },
    {
      "important": false,
      "id": "choline",
      "name": "Choline",
      "display_in_edit_form": false
    },
    {
      "display_in_edit_form": false,
      "id": "phylloquinone",
      "important": false,
      "name": "Vitamine K1"
    },
    {
      "display_in_edit_form": false,
      "id": "beta-glucan",
      "important": false,
      "name": "Bêta-glucanes"
    },
    {
      "display_in_edit_form": false,
      "id": "inositol",
      "important": false
    },
    {
      "display_in_edit_form": false,
      "id": "carnitine",
      "important": false
    }
  ]
}
@teolemon teolemon changed the title Expose the nutrient list API for Edit mode Add the new nutrient order and list API for edit mode Aug 30, 2021
@monsieurtanuki
Copy link
Contributor

@teolemon Correct me if I'm wrong, but should we rely on the order only, or on the structure of this file?
I'm saying that because "id": "polyunsaturated-fat" seems to be under "id": "butyric-acid", which is under "id": "fat".
Is that a bug in this file (as I suspect), and both "id": "polyunsaturated-fat" and "id": "butyric-acid" should be at the same level, under "id": "fat"?

@teolemon
Copy link
Member Author

@monsieurtanuki
Copy link
Contributor

If we focus just on omega3, there's an incoherence between your OP:

{
  "display_in_edit_form": false,
  "id": "omega-3-fat",
  "important": false,
  "name": "Acides gras Oméga 3"
},
{
  "display_in_edit_form": false,
  "important": false,
  "id": "alpha-linolenic-acid",
  "name": "Acide alpha-linolénique / ALA (18:3 n-3)"
},
{
  "important": false,
  "id": "eicosapentaenoic-acid",
  "name": "Acide eicosapentaénoïque / EPA (20:5 n-3)",
  "display_in_edit_form": false
},
{
  "name": "Acide docosahexaénoïque / DHA (22:6 n-3)",
  "important": false,
  "id": "docosahexaenoic-acid",
  "display_in_edit_form": false
},

... and the canonical form:

'-omega-3-fat-',
'--alpha-linolenic-acid-',
'--eicosapentaenoic-acid-',
'--docosahexaenoic-acid-',

The order is the same, but the level shouldn't be the same between omega3 and its "children".
Unless we should ignore the levels and just consider the order, but that would be strange.
It looks like a bug in https://fr.openfoodfacts.org/cgi/nutrients.pl

@monsieurtanuki monsieurtanuki self-assigned this Oct 18, 2021
@monsieurtanuki
Copy link
Contributor

I've just finished my loader (about to PR), and the structure still looks fishy in all 3 cases...

https://fr.openfoodfacts.org/cgi/nutrients.pl

energy-kj
energy-kcal
energy
-energy-from-fat
fat
-saturated-fat
--butyric-acid
---caproic-acid
---caprylic-acid
---capric-acid
---lauric-acid
---myristic-acid
---palmitic-acid
---stearic-acid
---arachidic-acid
---behenic-acid
---lignoceric-acid
---cerotic-acid
---montanic-acid
---melissic-acid
---monounsaturated-fat
---polyunsaturated-fat
---omega-3-fat
---alpha-linolenic-acid
---eicosapentaenoic-acid
---docosahexaenoic-acid
---omega-6-fat
---linoleic-acid
---arachidonic-acid
---gamma-linolenic-acid
---dihomo-gamma-linolenic-acid
---omega-9-fat
---oleic-acid
---elaidic-acid
---gondoic-acid
---mead-acid
---erucic-acid
---nervonic-acid
---trans-fat
---cholesterol
carbohydrates
-sugars
--sucrose
---glucose
---fructose
---lactose
---maltose
---maltodextrins
---starch
---polyols
---fiber
---soluble-fiber
---insoluble-fiber
proteins
-casein
--serum-proteins
--nucleotides
--salt
--sodium
--alcohol
vitamin-a
beta-carotene
vitamin-d
vitamin-e
vitamin-k
vitamin-c
vitamin-b1
vitamin-b2
vitamin-pp
vitamin-b6
vitamin-b9
folates
vitamin-b12
biotin
pantothenic-acid
silica
bicarbonate
potassium
chloride
calcium
phosphorus
iron
magnesium
zinc
copper
manganese
fluoride
selenium
chromium
molybdenum
iodine
caffeine
taurine
ph
fruits-vegetables-nuts
fruits-vegetables-nuts-dried
fruits-vegetables-nuts-estimate
collagen-meat-protein-ratio
cocoa
chlorophyl
carbon-footprint
carbon-footprint-from-meat-or-fish
nutrition-score-fr
nutrition-score-uk
glycemic-index
water-hardness
choline
phylloquinone
beta-glucan
inositol
carnitine

https://us.openfoodfacts.org/cgi/nutrients.pl

energy-kcal
energy
-energy-from-fat
fat
-saturated-fat
--butyric-acid
---caproic-acid
---caprylic-acid
---capric-acid
---lauric-acid
---myristic-acid
---palmitic-acid
---stearic-acid
---arachidic-acid
---behenic-acid
---lignoceric-acid
---cerotic-acid
---montanic-acid
---melissic-acid
---monounsaturated-fat
---polyunsaturated-fat
---omega-3-fat
---alpha-linolenic-acid
---eicosapentaenoic-acid
---docosahexaenoic-acid
---omega-6-fat
---linoleic-acid
---arachidonic-acid
---gamma-linolenic-acid
---dihomo-gamma-linolenic-acid
---omega-9-fat
---oleic-acid
---elaidic-acid
---gondoic-acid
---mead-acid
---erucic-acid
---nervonic-acid
---trans-fat
---cholesterol
salt
sodium
carbohydrates
-fiber
--soluble-fiber
---insoluble-fiber
---sugars
---added-sugars
---sucrose
---glucose
---fructose
---lactose
---maltose
---maltodextrins
---starch
---polyols
proteins
-casein
--serum-proteins
--nucleotides
--alcohol
vitamin-a
beta-carotene
vitamin-d
vitamin-e
vitamin-k
vitamin-c
vitamin-b1
vitamin-b2
vitamin-pp
vitamin-b6
vitamin-b9
folates
vitamin-b12
biotin
pantothenic-acid
silica
bicarbonate
potassium
chloride
calcium
phosphorus
iron
magnesium
zinc
copper
manganese
fluoride
selenium
chromium
molybdenum
iodine
caffeine
taurine
ph
fruits-vegetables-nuts
fruits-vegetables-nuts-dried
fruits-vegetables-nuts-estimate
collagen-meat-protein-ratio
cocoa
chlorophyl
carbon-footprint
carbon-footprint-from-meat-or-fish
nutrition-score-fr
nutrition-score-uk
glycemic-index
water-hardness

https://us-es.openfoodfacts.org/cgi/nutrients.pl

energy-kcal
energy
-energy-from-fat
fat
-saturated-fat
--butyric-acid
---caproic-acid
---caprylic-acid
---capric-acid
---lauric-acid
---myristic-acid
---palmitic-acid
---stearic-acid
---arachidic-acid
---behenic-acid
---lignoceric-acid
---cerotic-acid
---montanic-acid
---melissic-acid
---monounsaturated-fat
---polyunsaturated-fat
---omega-3-fat
---alpha-linolenic-acid
---eicosapentaenoic-acid
---docosahexaenoic-acid
---omega-6-fat
---linoleic-acid
---arachidonic-acid
---gamma-linolenic-acid
---dihomo-gamma-linolenic-acid
---omega-9-fat
---oleic-acid
---elaidic-acid
---gondoic-acid
---mead-acid
---erucic-acid
---nervonic-acid
---trans-fat
---cholesterol
salt
sodium
carbohydrates
-fiber
--soluble-fiber
---insoluble-fiber
---sugars
---added-sugars
---sucrose
---glucose
---fructose
---lactose
---maltose
---maltodextrins
---starch
---polyols
proteins
-casein
--serum-proteins
--nucleotides
--alcohol
vitamin-a
beta-carotene
vitamin-d
vitamin-e
vitamin-k
vitamin-c
vitamin-b1
vitamin-b2
vitamin-pp
vitamin-b6
vitamin-b9
folates
vitamin-b12
biotin
pantothenic-acid
silica
bicarbonate
potassium
chloride
calcium
phosphorus
iron
magnesium
zinc
copper
manganese
fluoride
selenium
chromium
molybdenum
iodine
caffeine
taurine
ph
fruits-vegetables-nuts
fruits-vegetables-nuts-dried
fruits-vegetables-nuts-estimate
collagen-meat-protein-ratio
cocoa
chlorophyl
carbon-footprint
carbon-footprint-from-meat-or-fish
nutrition-score-fr
nutrition-score-uk
glycemic-index
water-hardness

@stephanegigandet
Copy link
Contributor

@monsieurtanuki you are right, it is broken indeed. I filed a bug on the server: openfoodfacts/openfoodfacts-server#5997 Thanks a lot for the report.

monsieurtanuki added a commit to monsieurtanuki/openfoodfacts-dart that referenced this issue Oct 18, 2021
New files:
* `ordered_nutrient_test.dart`: Tests related to `OrderedNutrient` and `OrderedNutrients`
* `OrderedNutrient.dart`: Nutrient, as a hierarchically ordered and localized entity.
* `OrderedNutrients.dart`: Nutrients, as hierarchically ordered and localized entities.

Generated files (from JsonSerializable):
* `OrderedNutrient.g.dart`
* `OrderedNutrients.g.dart`
monsieurtanuki added a commit to monsieurtanuki/openfoodfacts-dart that referenced this issue Oct 18, 2021
…oring

Thanks to @peterwvj and @jasmeet0817!

Impacted files:
* `ordered_nutrient_test.dart`: added a comment, removed commented code
* `OrderedNutrient.dart`: simplified around JsonSerializable
* `OrderedNutrient.g.dart` (generated from JsonSerializable)
* `OrderedNutrients.dart`: simplified around JsonSerializable
* `OrderedNutrients.g.dart` (generated from JsonSerializable)
monsieurtanuki added a commit that referenced this issue Oct 19, 2021
Thanks to @peterwvj and @jasmeet0817!

New files:
* `ordered_nutrient_test.dart`: Tests related to `OrderedNutrient` and `OrderedNutrients`
* `OrderedNutrient.dart`: Nutrient, as a hierarchically ordered and localized entity.
* `OrderedNutrients.dart`: Nutrients, as hierarchically ordered and localized entities.

Generated files (from JsonSerializable):
* `OrderedNutrient.g.dart`
* `OrderedNutrients.g.dart`
monsieurtanuki added a commit to monsieurtanuki/openfoodfacts-dart that referenced this issue Oct 19, 2021
Impacted files:
* `openfoodfacts.dart`: created method `getOrderedNutrients`
* `ordered_nutrient_test.dart`: used new method `OpenFoodAPIClient.getOrderedNutrients`; refactored
monsieurtanuki added a commit to monsieurtanuki/openfoodfacts-dart that referenced this issue Nov 10, 2021
monsieurtanuki added a commit to monsieurtanuki/openfoodfacts-dart that referenced this issue Nov 10, 2021
monsieurtanuki added a commit that referenced this issue Nov 10, 2021
Impacted files:
* `openfoodfacts.dart`: created method `getOrderedNutrients`
* `ordered_nutrient_test.dart`: used new method `OpenFoodAPIClient.getOrderedNutrients`; refactored
@monsieurtanuki
Copy link
Contributor

Done in #272.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants