{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/akeda-ru/json-schema/akeda-ru-core-currency-rate-source-page-schema.json",
  "title": "CoreCurrencyRateSourcePage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/akeda-ru-core-currency-rates-api-openapi.yml#/components/schemas/CoreCurrencyRateSourcePage",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "items"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CoreCurrencyRateSource"
      }
    }
  },
  "$defs": {
    "CoreCurrencyRateSource": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "key",
        "title",
        "auto",
        "serves"
      ],
      "properties": {
        "key": {
          "$ref": "#/$defs/CoreCurrencyRateSourceKey"
        },
        "title": {
          "type": "string"
        },
        "auto": {
          "type": "boolean"
        },
        "note": {
          "type": "string"
        },
        "serves": {
          "type": "boolean"
        },
        "bridge": {
          "type": "string"
        },
        "unavailable": {
          "type": "boolean"
        },
        "reason": {
          "type": "string",
          "enum": [
            "manual_source",
            "currency_missing",
            "accounting_currency",
            "not_quoted"
          ],
          "description": "Почему serves=false: manual_source — у источника нет загрузчика, currency_missing — валюта не названа, accounting_currency — названа валюта учёта (её курс к себе — единица, не загружается), not_quoted — источник эту валюту не котирует"
        }
      }
    },
    "CoreCurrencyRateSourceKey": {
      "type": "string",
      "enum": [
        "manual",
        "cbr",
        "ecb",
        "coingecko",
        "erapi",
        "moex",
        "fixed"
      ]
    }
  }
}