{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openmedici-com/json-schema/openmedici-com-search-response-schema.json",
  "title": "SearchResponse",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/openmedici-com-v1-openapi.json#/components/schemas/SearchResponse",
  "type": "object",
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProgramSummary"
      }
    },
    "meta": {
      "type": "object",
      "required": [
        "limit",
        "offset",
        "count",
        "total",
        "page",
        "pages",
        "sort",
        "invalid"
      ],
      "properties": {
        "limit": {
          "type": "integer"
        },
        "offset": {
          "type": "integer"
        },
        "count": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        },
        "page": {
          "type": "integer"
        },
        "pages": {
          "type": "integer"
        },
        "sort": {
          "type": "string",
          "enum": [
            "rank",
            "deadline",
            "name",
            "recent"
          ]
        },
        "invalid": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "facets": {
          "$ref": "#/$defs/FacetCollection"
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false,
  "$defs": {
    "FacetCollection": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "$ref": "#/$defs/FacetItem"
        }
      }
    },
    "FacetItem": {
      "type": "object",
      "required": [
        "value",
        "label",
        "count"
      ],
      "properties": {
        "value": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "count": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "OrganizationSummary": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "name",
        "pageAvailable"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "pageAvailable": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "ProgramLifecycle": {
      "type": "string",
      "enum": [
        "active_accepting",
        "active_between_cycles",
        "active_no_applications",
        "paused",
        "ended",
        "renamed_or_moved",
        "inaccessible",
        "unclear"
      ]
    },
    "ProgramRanking": {
      "type": "object",
      "required": [
        "position",
        "tier",
        "score",
        "badge",
        "reason"
      ],
      "properties": {
        "position": {
          "type": "integer",
          "minimum": 1
        },
        "tier": {
          "type": "string",
          "enum": [
            "S",
            "A",
            "B",
            "Unscored"
          ]
        },
        "score": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 100
        },
        "badge": {
          "type": [
            "string",
            "null"
          ]
        },
        "reason": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "ProgramSummary": {
      "type": "object",
      "required": [
        "id",
        "slug",
        "name",
        "summary",
        "type",
        "lifecycle",
        "lifecycleCheckedAt",
        "fields",
        "eligibleCountries",
        "destinationCountries",
        "careerStages",
        "fundingMinUsd",
        "fundingMaxUsd",
        "officialUrl",
        "sourceCheckedAt",
        "organization",
        "nextDeadline",
        "ranking"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "summary": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": "string"
        },
        "lifecycle": {
          "$ref": "#/$defs/ProgramLifecycle"
        },
        "lifecycleCheckedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "fields": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "eligibleCountries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "destinationCountries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "careerStages": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "fundingMinUsd": {
          "type": [
            "number",
            "null"
          ]
        },
        "fundingMaxUsd": {
          "type": [
            "number",
            "null"
          ]
        },
        "officialUrl": {
          "type": "string",
          "format": "uri"
        },
        "sourceCheckedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "organization": {
          "$ref": "#/$defs/OrganizationSummary"
        },
        "nextDeadline": {
          "type": [
            "string",
            "null"
          ],
          "format": "date"
        },
        "ranking": {
          "$ref": "#/$defs/ProgramRanking"
        }
      },
      "additionalProperties": false
    }
  }
}