{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.leoverlay.com/schemas/idol-prices-v1.schema.json",
  "title": "Idol prices v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "catalogueRevision",
    "cycle",
    "page",
    "pageSize",
    "total",
    "quotes"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "catalogueRevision": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{64}$"
    },
    "cycle": {
      "type": "string"
    },
    "page": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000
    },
    "pageSize": {
      "const": 50
    },
    "total": {
      "type": "integer",
      "minimum": 0
    },
    "quotes": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "$ref": "#/$defs/quote"
      }
    }
  },
  "$defs": {
    "identity": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "cycle",
        "itemType",
        "subType",
        "rarity",
        "corrupted",
        "primordial",
        "weaversWill",
        "weaversTouch",
        "affixes"
      ],
      "properties": {
        "cycle": {
          "type": "string"
        },
        "itemType": {
          "type": "integer",
          "minimum": 0
        },
        "subType": {
          "type": "integer",
          "minimum": 0
        },
        "rarity": {
          "type": "string"
        },
        "corrupted": {
          "type": "boolean"
        },
        "primordial": {
          "type": "boolean"
        },
        "weaversWill": {
          "type": "integer",
          "minimum": 0
        },
        "weaversTouch": {
          "type": "integer",
          "minimum": 0
        },
        "affixes": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "tier",
              "type",
              "specialType",
              "sealedType"
            ],
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 0
              },
              "tier": {
                "type": "integer",
                "minimum": 0
              },
              "type": {
                "type": "string"
              },
              "specialType": {
                "type": "string"
              },
              "sealedType": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "quote": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "identity",
        "snapshotAt",
        "expiresAt",
        "status",
        "medianGold",
        "listingCount"
      ],
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0
        },
        "identity": {
          "$ref": "#/$defs/identity"
        },
        "snapshotAt": {
          "type": "number",
          "minimum": 0
        },
        "expiresAt": {
          "type": "number",
          "minimum": 0
        },
        "status": {
          "enum": [
            "available",
            "stale",
            "insufficient-data"
          ]
        },
        "medianGold": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "listingCount": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}
