{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "kerala_gold_rate_today.json, version 1",
  "description": "Kerala gold rates for 22K, 24K and 18K, per gram and per pavan. More keys may be added later: readers must ignore keys they do not know.",
  "type": "object",
  "required": [
    "schema_version",
    "currency",
    "region",
    "timezone",
    "grams_per_pavan",
    "rate_date",
    "updated_at",
    "rates"
  ],
  "properties": {
    "schema_version": {
      "const": 1
    },
    "currency": {
      "const": "INR"
    },
    "region": {
      "const": "Kerala"
    },
    "timezone": {
      "const": "Asia/Kolkata"
    },
    "grams_per_pavan": {
      "const": 8
    },
    "rate_date": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The Indian date the rate applies to (YYYY-MM-DD). It can be earlier than today."
    },
    "updated_at": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+05:30$",
      "description": "When the rate was last updated, Indian time (+05:30), whole seconds."
    },
    "rates": {
      "type": "object",
      "required": [
        "k22",
        "k24",
        "k18"
      ],
      "properties": {
        "k22": {
          "type": "object",
          "required": [
            "per_gram",
            "per_pavan"
          ],
          "properties": {
            "per_gram": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "description": "Rupees for 1 gram, whole rupees."
            },
            "per_pavan": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "description": "Rupees for 1 pavan (8 grams), whole rupees. Use as published."
            }
          }
        },
        "k24": {
          "type": "object",
          "required": [
            "per_gram",
            "per_pavan"
          ],
          "properties": {
            "per_gram": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "description": "Rupees for 1 gram, whole rupees."
            },
            "per_pavan": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "description": "Rupees for 1 pavan (8 grams), whole rupees. Use as published."
            }
          }
        },
        "k18": {
          "type": "object",
          "required": [
            "per_gram",
            "per_pavan"
          ],
          "properties": {
            "per_gram": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "description": "Rupees for 1 gram, whole rupees."
            },
            "per_pavan": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "description": "Rupees for 1 pavan (8 grams), whole rupees. Use as published."
            }
          }
        }
      }
    }
  }
}
