Nutrient Schema

Schema definition for the Nutrient object in product data

Nutrient Schema

This is a data schema, not an API endpoint. The Nutrient object describes the shape of data returned inside product records by the Product Opener API.

{
  "type": "object",
  "title": "nutrient",
  "properties": {
    "id": {
      "type": "string",
      "description": "id of the nutrient"
    },
    "name": {
      "type": "string",
      "description": "Name of the nutrient in the requested language"
    },
    "important": {
      "type": "boolean",
      "description": "Indicates if the nutrient is always shown on the nutrition facts table"
    },
    "display_in_edit_form": {
      "type": "boolean",
      "description": "Indicates if the nutrient should be shown in the nutrition facts edit form"
    },
    "unit": {
      "description": "Default unit of the nutrient",
      "type": "string",
      "enum": [
        "g",
        "mg",
        "μg",
        "cl",
        "ml",
        "dv",
        "% vol",
        "%"
      ]
    },
    "nutrients": {
      "type": "array",
      "description": "Nutrients and sub-nutrients of a product, with their name and default unit.\n(e.g. saturated-fat is a sub-nutrient of fat).\n",
      "items": {
        "$ref": "#/components/schemas/Nutrient"
      }
    }
  }
}