{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/remem-me/json-schema/remem-me-metrics-response-schema.json",
  "title": "MetricsResponse",
  "description": "Serializer for collection metrics endpoint (flat structure).\n\nResponse Format:\n    {\n      \"progress_v1\": {\n        \"percentage\": 72.0,\n        \"words_memorized\": 1450,\n        \"total_words\": 2013\n      },\n      \"stability_v1\": {\n        \"mastered\": 23,\n        \"in_progress\": 19,\n        \"pending\": 8\n      },\n      \"difficult_verses_v1\": [\n        {\n          \"verse_id\": 274544358678112,\n          \"reference\": \"Romans 8:28\",\n          \"passage_preview\": \"And we know that in all things God works for...\",\n          \"difficulty_score\": 0.82\n        }\n      ],\n      \"activity_v1\": {\n        \"avg_daily_words\": 3250,\n        \"participation_rate\": 0.685,\n        \"period_days\": 7\n      }\n    }\n\nNotes:\n    - Returns HTTP 204 when subscriber_count == 0 (handled in view)\n    - subscriber_count removed (now in collection detail endpoint)\n    - Flat structure - metrics at top level, no wrapper\n    - Metrics are versioned (progress_v1, stability_v1, etc.) for future schema evolution\n    - Uses SerializerMethodField to defer expensive calculations\n    - Each metric field is independently nullable (can be None on error)",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/remem-me-openapi.yml#/components/schemas/MetricsResponse",
  "type": "object",
  "properties": {
    "progress_v1": {
      "type": "object",
      "additionalProperties": {},
      "description": "Get progress metric for this collection.\n\nArgs:\n    obj: Deck instance\n\nReturns:\n    Dict with percentage, words_memorized, total_words",
      "readOnly": true
    },
    "stability_v1": {
      "type": "object",
      "additionalProperties": {},
      "description": "Get stability metric for this collection.\n\nArgs:\n    obj: Deck instance\n\nReturns:\n    Dict with mastered, in_progress, new counts",
      "readOnly": true
    },
    "difficult_verses_v1": {
      "type": "array",
      "items": {},
      "description": "Get difficult verses metric for this collection.\n\nArgs:\n    obj: Deck instance\n\nReturns:\n    List of dicts with verse_id, reference, passage_preview, difficulty_score",
      "readOnly": true
    },
    "activity_v1": {
      "type": "object",
      "additionalProperties": {},
      "description": "Get activity metric for this collection.\n\nArgs:\n    obj: Deck instance\n\nReturns:\n    Dict with avg_daily_words, participation_rate, period_days",
      "readOnly": true
    }
  },
  "required": [
    "activity_v1",
    "difficult_verses_v1",
    "progress_v1",
    "stability_v1"
  ]
}