{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Better Beans v1 variant history",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "variant_id",
    "range",
    "truncated",
    "data"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "variant_id": {
      "type": "string"
    },
    "range": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "from",
        "to"
      ],
      "properties": {
        "from": {
          "type": "string",
          "format": "date"
        },
        "to": {
          "type": "string",
          "format": "date"
        }
      }
    },
    "truncated": {
      "type": "boolean"
    },
    "data": {
      "type": "array",
      "maxItems": 500,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "variant_id",
          "observed_at",
          "recorded_at",
          "source_url",
          "purchase_type",
          "availability",
          "shipping_scope",
          "tax_scope",
          "series_key",
          "product_version_key",
          "corrects_observation_id",
          "size_label",
          "unit_weight_grams",
          "total_weight_grams",
          "listed_price",
          "regular_price",
          "sale_price",
          "price_per_100g",
          "currency",
          "market",
          "revision",
          "pack_count",
          "has_promotion_conditions"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "variant_id": {
            "type": "string"
          },
          "observed_at": {
            "type": "string"
          },
          "recorded_at": {
            "type": "string"
          },
          "source_url": {
            "type": "string"
          },
          "purchase_type": {
            "type": "string"
          },
          "availability": {
            "type": "string"
          },
          "shipping_scope": {
            "type": "string"
          },
          "tax_scope": {
            "type": "string"
          },
          "series_key": {
            "type": "string"
          },
          "product_version_key": {
            "type": "string"
          },
          "corrects_observation_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "size_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "unit_weight_grams": {
            "type": [
              "string",
              "null"
            ]
          },
          "total_weight_grams": {
            "type": [
              "string",
              "null"
            ]
          },
          "listed_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "regular_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "sale_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "price_per_100g": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "market": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "pack_count": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "has_promotion_conditions": {
            "type": "boolean"
          }
        }
      }
    }
  }
}
