{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/myrmigo-com/json-schema/myrmigo-com-rights-input-schema.json",
  "title": "RightsInput",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/myrmigo-com-openapi.json#/components/schemas/RightsInput",
  "type": "object",
  "properties": {
    "flight_date": {
      "type": "string",
      "description": "Scheduled departure, YYYY-MM-DD"
    },
    "from": {
      "type": "string",
      "description": "IATA airport where the booking starts"
    },
    "to": {
      "type": "string",
      "description": "IATA airport, final destination"
    },
    "carrier": {
      "description": "Operating airline: IATA code or name",
      "type": [
        "string",
        "null"
      ]
    },
    "event": {
      "type": "string",
      "enum": [
        "cancelled",
        "delayed",
        "denied_boarding",
        "downgraded"
      ],
      "description": "cancelled: by the airline; denied_boarding: refused against their will, e.g. overbooking"
    },
    "arrival_delay_minutes": {
      "description": "At the final destination; if rerouted, on the new flight",
      "type": [
        "number",
        "null"
      ]
    },
    "notice_days": {
      "description": "cancelled: whole days' notice before departure",
      "type": [
        "number",
        "null"
      ]
    },
    "reroute_departure_offset_minutes": {
      "description": "cancelled: new minus original departure (negative: earlier)",
      "type": [
        "number",
        "null"
      ]
    },
    "cause": {
      "description": "Reason the airline gave",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "unknown",
            "technical",
            "operational",
            "airline_strike",
            "external_strike",
            "weather",
            "air_traffic_control",
            "security",
            "bird_strike",
            "earlier_flight",
            "other_external"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "distance_km": {
      "description": "Only if an airport is not recognised",
      "type": [
        "number",
        "null"
      ]
    }
  },
  "required": [
    "flight_date",
    "from",
    "to",
    "event"
  ]
}