{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/superwall/json-schema/superwall-doctor-report-schema.json",
  "title": "DoctorReport",
  "x-generated": "2026-10-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/superwall-openapi.json#/components/schemas/DoctorReport",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "doctor_report"
      ],
      "description": "Object type, always `doctor_report`."
    },
    "project_id": {
      "type": "string"
    },
    "generated_at": {
      "type": "string",
      "description": "ISO 8601 timestamp of when the report was generated."
    },
    "summary": {
      "$ref": "#/$defs/DoctorReportSummary"
    },
    "checks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DoctorCheckResult"
      },
      "description": "Structured check results. Use this to react programmatically; use `markdown` for a ready-to-read report."
    },
    "markdown": {
      "type": "string",
      "description": "Markdown-rendered version of the report, ready to present to a human or LLM agent."
    }
  },
  "required": [
    "object",
    "project_id",
    "generated_at",
    "summary",
    "checks",
    "markdown"
  ],
  "additionalProperties": false,
  "$defs": {
    "DoctorCheckResult": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable identifier for the check, e.g. `ios.asc_api_key`. Group checks by id to track them over time."
        },
        "title": {
          "type": "string",
          "description": "Human-readable title for the check result."
        },
        "application_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The application this result applies to, or null for project-wide results."
        },
        "platform": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "ios"
                  ],
                  "description": "iOS (App Store)"
                },
                {
                  "type": "string",
                  "enum": [
                    "android"
                  ],
                  "description": "Android (Google Play)"
                },
                {
                  "type": "string",
                  "enum": [
                    "flutter"
                  ],
                  "description": "Flutter (legacy, read-only - cannot be created via API)"
                },
                {
                  "type": "string",
                  "enum": [
                    "react_native"
                  ],
                  "description": "React Native (legacy, read-only - cannot be created via API)"
                },
                {
                  "type": "string",
                  "enum": [
                    "web"
                  ],
                  "description": "Web (Stripe)"
                },
                {
                  "type": "string",
                  "enum": [
                    "promotional"
                  ],
                  "description": "Promotional offers application (read-only - cannot be created via API)"
                },
                {
                  "type": "string",
                  "enum": [
                    "webapp"
                  ],
                  "description": "Web App (Web SDK) (read-only - cannot be created via API)"
                }
              ],
              "description": "Platform type for the application"
            },
            {
              "type": "null"
            }
          ],
          "description": "Platform of the application this result applies to, if any."
        },
        "severity": {
          "type": "string",
          "enum": [
            "error",
            "warning",
            "info",
            "ok"
          ],
          "description": "Severity of the check result. `error` blocks a healthy configuration; `warning` is a soft issue you should look at; `info` is informational; `ok` means the check passed."
        },
        "priority": {
          "type": "string",
          "enum": [
            "p0",
            "p1",
            "p2",
            "p3"
          ],
          "description": "Priority used to sort/group checks in the report. `p0` is most urgent; `p3` is informational."
        },
        "passed": {
          "type": "boolean",
          "description": "Whether the check considers the configuration healthy."
        },
        "message": {
          "type": "string",
          "description": "Short description of the finding, suitable for inclusion in a markdown report."
        },
        "remediation": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Concrete steps the operator/agent can take to fix this."
        },
        "docs_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Link to Superwall documentation for the relevant topic."
        },
        "metadata": {
          "type": "object",
          "description": "Free-form structured data about the finding (e.g. product identifier, ASC state)."
        }
      },
      "required": [
        "id",
        "title",
        "application_id",
        "platform",
        "severity",
        "priority",
        "passed",
        "message",
        "remediation",
        "docs_url",
        "metadata"
      ],
      "additionalProperties": false
    },
    "DoctorReportSummary": {
      "type": "object",
      "properties": {
        "errors": {
          "type": "number"
        },
        "warnings": {
          "type": "number"
        },
        "infos": {
          "type": "number"
        },
        "passed": {
          "type": "number"
        }
      },
      "required": [
        "errors",
        "warnings",
        "infos",
        "passed"
      ],
      "additionalProperties": false
    }
  }
}