{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/allianz-engagement-survey/json-schema/allianz-engagement-survey-survey-analytics-schema.json",
  "title": "SurveyAnalytics",
  "description": "Aggregated analytics and insights for an engagement survey",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/allianz-engagement-survey-analytics-api-openapi.yml#/components/schemas/SurveyAnalytics",
  "type": "object",
  "properties": {
    "survey_id": {
      "type": "string",
      "description": "Survey being analyzed"
    },
    "participation_rate": {
      "type": "number",
      "format": "double",
      "description": "Percentage of invited employees who responded"
    },
    "engagement_score": {
      "type": "number",
      "format": "double",
      "description": "Overall engagement score out of 100"
    },
    "favorable_percentage": {
      "type": "number",
      "format": "double",
      "description": "Percentage of favorable responses across all questions"
    },
    "question_scores": {
      "type": "array",
      "description": "Per-question score breakdown",
      "items": {
        "$ref": "#/$defs/QuestionScore"
      }
    }
  },
  "$defs": {
    "QuestionScore": {
      "title": "QuestionScore",
      "type": "object",
      "description": "Score summary for a single survey question",
      "properties": {
        "question_id": {
          "type": "string",
          "description": "Question identifier"
        },
        "question": {
          "type": "string",
          "description": "The survey question text"
        },
        "score": {
          "type": "number",
          "format": "double",
          "description": "Average score on a 1-5 scale"
        },
        "favorable": {
          "type": "number",
          "format": "double",
          "description": "Percentage of favorable responses (4-5 on Likert scale)"
        }
      }
    }
  }
}