{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/api-evangelist/moodys-corporation/json-schema/moodys-corporation-time-series-schema.json",
  "title": "Moody's Analytics Time Series",
  "description": "An economic, demographic, or financial time series returned from the Moody's Analytics Data Buffet API.",
  "type": "object",
  "required": ["mnemonic", "frequency", "observations"],
  "properties": {
    "mnemonic": { "type": "string", "description": "Unique series identifier in Moody's Data Buffet." },
    "name": { "type": "string" },
    "description": { "type": "string" },
    "geography": { "type": "string", "description": "ISO country / region code." },
    "source": { "type": "string", "description": "Originating data provider (e.g. BLS, BEA, IMF, Eurostat)." },
    "category": { "type": "string" },
    "frequency": {
      "type": "string",
      "enum": ["Daily","Weekly","Monthly","Quarterly","Annual"]
    },
    "transformation": {
      "type": "string",
      "enum": ["None","PctChange","YoYPctChange","Difference","Log","Index"]
    },
    "units": { "type": "string" },
    "vintage": { "type": "string", "description": "Vintage / publication tag for forecast series." },
    "observations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["date", "value"],
        "properties": {
          "date": { "type": "string", "format": "date" },
          "value": { "type": ["number", "null"] }
        }
      }
    }
  }
}
